jon.recoil.org

Module Monad.IdentitySource

Sourcetype 'a t = 'a
include S2 with type ('a, _) t := 'a t
Sourceval bind : 'a t -> ('a -> 'b t) -> 'b t
Sourceval (>>=) : 'a t -> ('a -> 'b t) -> 'b t

>>= is a synonym for bind

Sourceval return : 'a -> 'a t

return v returns the (trivial) computation that returns v.

Sourceval map : ('a -> 'b) -> 'a t -> 'b t
Sourceval join : 'a t t -> 'a t

join t is t >>= (fun t' -> t').

Sourceval both : 'a t -> 'b t -> ('a * 'b) t
Sourceval ignore_m : _ t -> unit t

ignore_m t is map (fun _ -> ()) t.

Sourceval all : 'a t list -> 'a list t
Sourceval all_unit : unit t list -> unit t

Like all, but ensures that every monadic value in the list produces a unit value, all of which are discarded rather than being collected into a list.

Sourcemodule Syntax : sig ... end

As described at https://ocaml.org/manual/latest/bindingops.html