Module B00_std.Result

Result values

include module type of Stdlib.Result
type ('a, 'e) t = ('a'e) Stdlib.result =
| Ok of 'a
| Error of 'e
val ok : 'a -> ('a'e) Stdlib.result
val error : 'e -> ('a'e) Stdlib.result
val value : ('a'e) Stdlib.result -> default:'a -> 'a
val get_ok : ('a'e) Stdlib.result -> 'a
val get_error : ('a'e) Stdlib.result -> 'e
val bind : ('a'e) Stdlib.result -> ('a -> ('b'e) Stdlib.result) -> ('b'e) Stdlib.result
val join : (('a'e) Stdlib.result'e) Stdlib.result -> ('a'e) Stdlib.result
val map : ('a -> 'b) -> ('a'e) Stdlib.result -> ('b'e) Stdlib.result
val map_error : ('e -> 'f) -> ('a'e) Stdlib.result -> ('a'f) Stdlib.result
val fold : ok:('a -> 'c) -> error:('e -> 'c) -> ('a'e) Stdlib.result -> 'c
val iter : ('a -> unit) -> ('a'e) Stdlib.result -> unit
val iter_error : ('e -> unit) -> ('a'e) Stdlib.result -> unit
val is_ok : ('a'e) Stdlib.result -> bool
val is_error : ('a'e) Stdlib.result -> bool
val equal : ok:('a -> 'a -> bool) -> error:('e -> 'e -> bool) -> ('a'e) Stdlib.result -> ('a'e) Stdlib.result -> bool
val compare : ok:('a -> 'a -> int) -> error:('e -> 'e -> int) -> ('a'e) Stdlib.result -> ('a'e) Stdlib.result -> int
val to_option : ('a'e) Stdlib.result -> 'a option
val to_list : ('a'e) Stdlib.result -> 'a list
val to_seq : ('a'e) Stdlib.result -> 'a Stdlib.Seq.t
val to_failure : ('a, string) Stdlib.result -> 'a

to_failure r is failwith e if r is Error e and v if r is Ok v.

val to_invalid_arg : ('a, string) Stdlib.result -> 'a

to_invalid_arg r is invalid_arg e if r is Error e and v if r is Ok v.

module Syntax : sig ... end

let operators.