Monad.ListThe List monad.
The list monad denotes a non-deterministic computation, i.e., a computation that can have more than one result or no results at all.
module type S = sig ... endmodule type S2 = sig ... endinclude S with type 'a t = 'a list and type 'a m = 'a and type 'a e = 'a listinclude 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.