Monad.OptionThe option aka Maybe monad.
This monad can be used to denote partial computations or a limited form of non-deterministic computations where an absence of result, i.e., the bottom value, can be considered as a possible outcome.
module type S = sig ... endThe unary option monad.
module type S2 = sig ... endThe binary option monad
include S
with type 'a t = 'a option
and type 'a m = 'a
and type 'a e = 'a optioninclude Monad with type 'a t := 'a tsequence xs computes a sequence of computations xs in the left to right order.
module Fn : sig ... endVarious function combinators lifted into the Kleisli category.
module Pair : sig ... endThe pair interface lifted into the monad.
module Triple : sig ... endThe triple interface lifted into a monad.
module Lift : sig ... endLifts functions into the monad.
module Exn : sig ... endInteracting between monads and language exceptions
module Collection : sig ... endLifts collection interface into the monad.
module List : Collection.S with type 'a t := 'a listThe Monad.Collection.S interface for lists
module Seq : Collection.S with type 'a t := 'a Core_kernel.Sequence.tThe Monad.Collection.S interface for sequences
include Syntax.Let.S with type 'a t := 'a tinclude Core_kernel.Monad.S with type 'a t := 'a tmodule Monad_infix : sig ... endval return : 'a -> 'a tmodule Let_syntax : sig ... endmodule Let : Syntax.Let.S with type 'a t := 'a tMonadic operators, see Monad.Syntax.S for more.
Monadic operators, see Monad.Syntax.S for more.
include Choice.S with type 'a t := 'a tinclude Choice.Basic with type 'a t := 'a tval pure : 'a -> 'a tpure x creates a computation that results in x.
val accept : 'a -> 'a taccept x accepts x as a result of computation. (Same as pure x.
val reject : unit -> 'a treject () rejects the rest of computation sequence, and terminate the computation with the zero result (Same as zero ()
val guard : bool -> unit tguard cond ensures cond is true in the rest of computation. Otherwise the rest of the computation is rejected.