Module Future.Result


module Future.Result: Extlib.Result

type ('a, 'b) t = ('a, 'b) Extlib.Std.result 
The type of a result
val catch : ('a -> 'b) -> 'a -> ('b, exn) Extlib.Std.result
Execute a function and catch any exception as a !result
val of_option : 'a option -> ('a, unit) Extlib.Std.result
Convert an option to a result
val to_option : ('a, 'b) Extlib.Std.result -> 'a option
Convert a result to an option
val bind : ('a, 'b) Extlib.Std.result ->
('a -> ('c, 'b) Extlib.Std.result) -> ('c, 'b) Extlib.Std.result
Monadic composition.

bind r f proceeds as f x if r is Ok x, or returns r if r is an error.

val (>>=) : ('a, 'b) Extlib.Std.result ->
('a -> ('c, 'b) Extlib.Std.result) -> ('c, 'b) Extlib.Std.result
as bind

Boilerplate code


S-Expressions

val t_of_sexp : (Sexplib.Sexp.t -> 'a) ->
(Sexplib.Sexp.t -> 'b) -> Sexplib.Sexp.t -> ('a, 'b) t
val sexp_of_t : ('a -> Sexplib.Sexp.t) ->
('b -> Sexplib.Sexp.t) -> ('a, 'b) t -> Sexplib.Sexp.t