Fail.S
The unary fail monad interface.
Implemented by:
type 'a error
a type of error
type 'a t
a monad type
val fail : _ error -> 'a t
fail err diverges the computation, possibly providing an extra information in a value of type _ error.
fail err
_ error
val catch : 'a t -> (_ error -> 'a t) -> 'a t
catch m f if m diverges with some bottom value err, the f err is a result of the whole computation, otherwise returns m.
catch m f
m
err
f err