Module type Monad.Basic

Basic monad interface.

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

bind m f passes the result of computation m to function f

val return : 'a -> 'a t

return x creates a trivial computation that results in x

val map : [ `Define_using_bind | `Custom of 'a t -> f:( 'a -> 'b ) -> 'b t ]

map function can be derived from bind or provided explicitly