module Result:sig
..end
type ('a, 'b)
result =
| |
Ok of |
| |
Error of |
val maybe : ('a -> 'b) -> 'a -> ('b, exn) result
maybe f x
: evaluate f x
, returning Failure exn
if exception
exn
was raised during evaluation, and Success (f x)
otherwise.f
: some function to apply to xx
: some value