Module type Monad.Basic3_indexed

Argument to Make*. This module type subsumes the other Basic* types below.

type ('a, 'i, 'j, 'p, 'q) t
val return : 'a 'i 'p 'q. 'a -> ('a, 'i, 'i, 'p, 'q) t
val map : 'a 'b 'i 'j 'p 'q. [ `Define_using_bind | `Custom of ('a, 'i, 'j, 'p, 'q) t -> f:('a -> 'b) -> ('b, 'i, 'j, 'p, 'q) t ]

`Define_using_bind defines map as bind t ~f:(fun x -> return x). `Custom overrides the default, presumably with something more efficient.

Some functions returned by Make* are defined in terms of map. Providing an efficient map improves them as well.

val bind : 'a 'b 'i 'j 'k 'p 'q. ('a, 'i, 'j, 'p, 'q) t -> f:('a -> ('b, 'j, 'k, 'p, 'q) t) -> ('b, 'i, 'k, 'p, 'q) t