Module type Interfaces.MONAD

Interface for a module with a monadic container.

type _ t

'a t is a monadic container with elements of type 'a.

val return : 'a -> 'a t

return a puts the elements a into a monadic container.

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

m >> f extracts elements of of the monadic container m and applies the function f to them which puts them back into a monadic container.

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

let* a = m in f a is the same as m >>= f.