Module Monads.Std.Monad.Result

module Result: sig .. end
The Result Monad.

The result monad is a generalization of the Option monad, where the bottom type can bear an arbitrary value of type 'e. The type 'e is fixed and can not be changed during the computation.

Monad.Result.Error is a specialization of the Result monad where 'e is fixed to Error.t.

Monad.Result.Exception is another specialization that fixes 'e to the exn type.


type ('a, 'e) result = ('a, 'e) Std.Result.t = 
| Ok of 'a
| Error of 'e
module type S = sig .. end
module type S2 = sig .. end
module T1 (T : Std.T)  (M : Std.Monad.Monad) : sig .. end
module T2 (M : Std.Monad.Monad) : sig .. end
module Make (T : Std.T)  (M : Std.Monad.Monad) : S 
        with type 'a t := 'a T1(T)(M).t
         and type 'a m := 'a T1(T)(M).m
         and type 'a e := 'a T1(T)(M).e
         and type err := T.t
Make(E)(M) concretized the type of error to E.t and composes the Result monad with the monad M.
module Make2 (M : Std.Monad.Monad) : S2 
        with type ('a,'e) t := ('a,'e) T2(M).t
         and type 'a m     := 'a     T2(M).m
         and type ('a,'e) e := ('a,'e) T2(M).e
Make2(M) composes the result monad with the monad M.
module Error: sig .. end
The Error monad.
module Exception: sig .. end
The Exception monad.