module Or_error: Or_errortype'at =('a, Error.t) Result.t
include Monad.S
val try_with : ?backtrace:bool -> (unit -> 'a) -> 'a ttry_with f catches exceptions thrown by f and returns them in the Result.t as an
Error.t. try_with_join is like try_with, except that f can throw exceptions or
return an Error directly, without ending up with a nested error; it is equivalent to
Result.join (try_with f).val try_with_join : ?backtrace:bool -> (unit -> 'a t) -> 'a tval ok_exn : 'a t -> 'aok_exn t throws an exception if t is an Error, and otherwise returns the
contents of the Ok constructor.val of_exn : ?backtrace:[ `Get | `This of string ] -> exn -> 'a tof_exn exn is Error (Error.of_exn exn).val of_exn_result : ('a, exn) Result.t -> 'a tof_exn_result (Ok a) = Ok a, of_exn_result (Error exn) = of_exn exnval error : string -> 'a -> ('a -> Sexplib.Sexp.t) -> 'b terror message value sexp_of_value constructs an Error.t and returns it as a
Result.Error.val error_string : string -> 'a terror_string message is Error (Error.of_string message)val tag : 'a t -> string -> 'a ttag t string is Result.map_error t ~f:(fun e -> Error.tag e string).
tag_arg is similar.val tag_arg : 'a t -> string -> 'b -> ('b -> Sexplib.Sexp.t) -> 'a tval unimplemented : string -> 'a tunimplemented name returns a standard error value for an unimplemented value.val combine_errors : 'a t list -> 'a list tcombine_errors ts returns Ok if every element in ts is Ok, else it returns
Error with all the errors in ts. More precisely:
| combine_errors Ok a1; ...; Ok an = Ok a1; ...; an
| combine_errors ...; Error e1; ...; Error en; ...
| = Error (Error.of_list e1; ...; en)
val combine_errors_unit : unit t list -> unit tcombine_errors_unit returns Ok if every element in ts is Ok (), else it
returns Error with all the errors in ts, like combine_errors.val t_of_sexp : (Sexplib.Sexp.t -> 'a) -> Sexplib.Sexp.t -> 'a tval sexp_of_t : ('a -> Sexplib.Sexp.t) -> 'a t -> Sexplib.Sexp.tval bin_t : 'a Bin_prot.Type_class.t -> 'a t Bin_prot.Type_class.tval bin_read_t : 'a Bin_prot.Unsafe_read_c.reader -> 'a t Bin_prot.Read_ml.readerval bin_read_t_ : 'a Bin_prot.Unsafe_read_c.reader ->
'a t Bin_prot.Unsafe_read_c.readerval bin_read_t__ : 'a Bin_prot.Unsafe_read_c.reader ->
(int -> 'a t) Bin_prot.Unsafe_read_c.readerval bin_reader_t : 'a Bin_prot.Type_class.reader -> 'a t Bin_prot.Type_class.readerval bin_size_t : 'a Bin_prot.Size.sizer -> 'a t Bin_prot.Size.sizerval bin_write_t : 'a Bin_prot.Unsafe_write_c.writer -> 'a t Bin_prot.Write_ml.writerval bin_write_t_ : 'a Bin_prot.Unsafe_write_c.writer ->
'a t Bin_prot.Unsafe_write_c.writerval bin_writer_t : 'a Bin_prot.Type_class.writer -> 'a t Bin_prot.Type_class.writertry_with f catches exceptions thrown by f and returns them in the Result.t as an
Error.t. try_with_join is like try_with, except that f can throw exceptions or
return an Error directly, without ending up with a nested error; it is equivalent to
Result.join (try_with f).ok_exn t throws an exception if t is an Error, and otherwise returns the
contents of the Ok constructor.of_exn exn is Error (Error.of_exn exn).of_exn_result (Ok a) = Ok a, of_exn_result (Error exn) = of_exn exnerror message value sexp_of_value constructs an Error.t and returns it as a
Result.Error.error_string message is Error (Error.of_string message)tag t string is Result.map_error t ~f:(fun e -> Error.tag e string).
tag_arg is similar.unimplemented name returns a standard error value for an unimplemented value.combine_errors ts returns Ok if every element in ts is Ok, else it returns
Error with all the errors in ts. More precisely:
| combine_errors Ok a1; ...; Ok an = Ok a1; ...; an
| combine_errors ...; Error e1; ...; Error en; ...
| = Error (Error.of_list e1; ...; en)
combine_errors_unit returns Ok if every element in ts is Ok (), else it
returns Error with all the errors in ts, like combine_errors.