Parameter Make.M

type +'a t

The type of actions in the monad.

val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val (let*) : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val (and*) : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....