Parameter Make.1-X
val bind : 'a t -> f:('a -> 'b t) -> 'b tval return : 'a -> 'a tThe following identities ought to hold (for some value of =):
return x >>= f = f xt >>= fun x -> return x = t(t >>= f) >>= g = t >>= fun x -> (f x >>= g)
Note:
>>=is the infix notation forbind)
val map : [ `Define_using_bind | `Custom of 'a t -> f:('a -> 'b) -> 'b t ]The
mapargument toMonad.Makesays how to implement the monad'smapfunction.`Define_using_bindmeans to definemap t ~f = bind t ~f:(fun a -> return (f a)).`Customoverrides the default implementation, presumably with something more efficient.Some other functions returned by
Monad.Makeare defined in terms ofmap, so passing in a more efficientmapwill improve their efficiency as well.