jon.recoil.org

Parameter Make.X

type 'a t
include Ocaml_utils.Misc_stdlib.Monad.Basic2 with type ('a, _) t := 'a X.t
val bind : 'a X.t -> ('a -> 'b X.t) -> 'b X.t
val return : 'a -> 'a X.t

The following identities ought to hold (for some value of =):

  • return x >>= f = f x
  • t >>= fun x -> return x = t
  • (t >>= f) >>= g = t >>= fun x -> (f x >>= g)

Note: >>= is the infix notation for bind)