Module type Indexed_monad.CORE

Basis operations.

type ('a, 'index) t

The type held by the Indexed Monad.

include WITH_RETURN with type ('a, 'index) t := ('a, 'index) t
include Indexed_bind.WITH_BIND with type ('a, 'index) t := ('a, 'index) t
val bind : ('a -> ('b, 'index) t) -> ('a, 'index) t -> ('b, 'index) t

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

include WITH_RETURN with type ('a, 'index) t := ('a, 'index) t
include Indexed_bind.WITH_MAP_AND_JOIN with type ('a, 'index) t := ('a, 'index) t
val map : ('a -> 'b) -> ('a, 'index) t -> ('b, 'index) t

Mapping over from 'a to 'b.

val join : (('a, 'index) t, 'index) t -> ('a, 'index) t

join remove one level of monadic structure, projecting its bound argument into the outer level.

include WITH_RETURN with type ('a, 'index) t := ('a, 'index) t
val return : 'a -> ('a, 'index) t

Lift a value into a t.

include Indexed_bind.WITH_KLEISLI_COMPOSITION with type ('a, 'index) t := ('a, 'index) t
val compose_left_to_right : ('a -> ('b, 'index) t) -> ('b -> ('c, 'index) t) -> 'a -> ('c, 'index) t

Composing monadic functions using Kleisli Arrow (from left to right).