module BatResult:Monadic results of computations that can raise exceptionssig
..end
type('a, 'b)
t =('a, 'b) BatStd.result
val catch : ('a -> 'b) -> 'a -> ('b, exn) BatStd.result
!result
val of_option : 'a option -> ('a, unit) BatStd.result
option
to a result
val to_option : ('a, 'b) BatStd.result -> 'a option
result
to an option
val bind : ('a, 'b) BatStd.result ->
('a -> ('c, 'b) BatStd.result) -> ('c, 'b) BatStd.result
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
bind