Monad.Option
type 'a t = 'a option
include S2 with type ('a, _) t := 'a t
val bind : 'a t -> ('a -> 'b t) -> 'b t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
>>= is a synonym for bind
>>=
bind
val return : 'a -> 'a t
return v returns the (trivial) computation that returns v.
return v
val map : ('a -> 'b) -> 'a t -> 'b t
val join : 'a t t -> 'a t
join t is t >>= (fun t' -> t').
join t
t >>= (fun t' -> t')
val both : 'a t -> 'b t -> ('a * 'b) t
val ignore_m : _ t -> unit t
ignore_m t is map (fun _ -> ()) t.
ignore_m t
map (fun _ -> ()) t
val all : 'a t list -> 'a list t
val 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.
all
module Syntax : sig ... end
As described at https://ocaml.org/manual/latest/bindingops.html