Module BatResult


module BatResult: sig .. end
Monadic results of computations that can raise exceptions


Monadic results of computations that can raise exceptions
type ('a, 'b) t = ('a, 'b) BatStd.result 
The type of a result
val catch : ('a -> 'b) -> 'a -> ('b, exn) BatStd.result
Execute a function and catch any exception as a !result
val of_option : 'a option -> ('a, unit) BatStd.result
Convert an option to a result
val to_option : ('a, 'b) BatStd.result -> 'a option
Convert a result to an option
val bind : ('a, 'b) BatStd.result ->
('a -> ('c, 'b) BatStd.result) -> ('c, 'b) BatStd.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) BatStd.result ->
('a -> ('c, 'b) BatStd.result) -> ('c, 'b) BatStd.result
as bind

Boilerplate code