package lsp

  1. Overview
  2. Docs
Legend:
Page
Library
Module
Module type
Parameter
Class
Class type
Source

Module Stdune.ResultSource

Result type

Sourcetype ('a, 'error) t = ('a, 'error) result =
  1. | Ok of 'a
  2. | Error of 'error
Sourceval return : 'a -> ('a, _) t
Sourceval ok : 'a -> ('a, _) t
Sourceval value : ('a, 'e) result -> default:'a -> 'a

value r ~default is v if r is Ok v and default otherwise.

Sourceval is_ok : (_, _) t -> bool
Sourceval is_error : (_, _) t -> bool
Sourceval iter : ('a, _) t -> f:('a -> unit) -> unit
Sourceval ok_exn : ('a, exn) t -> 'a
Sourceval try_with : (unit -> 'a) -> ('a, exn) t
Sourceval equal : ('a -> 'a -> bool) -> ('b -> 'b -> bool) -> ('a, 'b) t -> ('a, 'b) t -> bool
Sourceval hash : ('a -> int) -> ('b -> int) -> ('a, 'b) t -> int
Sourcemodule O : sig ... end
Sourceval map : ('a, 'error) t -> f:('a -> 'b) -> ('b, 'error) t
Sourceval bind : ('a, 'error) t -> f:('a -> ('b, 'error) t) -> ('b, 'error) t
Sourceval (>>=) : ('a, 'error) t -> ('a -> ('b, 'error) t) -> ('b, 'error) t
Sourceval map_error : ('a, 'error1) t -> f:('error1 -> 'error2) -> ('a, 'error2) t
Sourceval to_option : ('a, 'error) t -> 'a option
Sourceval to_dyn : 'a Dyn.builder -> 'error Dyn.builder -> ('a, 'error) t Dyn.builder
Sourceval errorf : ('a, unit, string, (_, string) t) format4 -> 'a

Produce Error <message>

Sourcetype ('a, 'error) result = ('a, 'error) t

For compatibility with some other code

Sourcemodule List : sig ... end
Sourcemodule Option : sig ... end
OCaml

Innovation. Community. Security.