To_S.Minclude Base.Monad.S2module Let_syntax : sig ... endmodule Monad_infix : sig ... endSame as Infix, except the monad type has two arguments. The second is always just passed through.
include State_types.Generic
with type ('a, 's) t := ('a, 's) t
and type 's state := 's
and type 'a final := 'aState monads share the signatures of their builder functions with state transformers...
include State_transform_types.Generic_builders
with type ('a, 's) t := ('a, 's) t
with type 's state := 's
with type 'a final := 'ainclude State_transform_types.Generic_types
with type ('a, 's) t := ('a, 's) t
with type 's state := 's
with type 'a final := 'aval make : ('s -> 's * 'a) -> ('a, 's) tmake creates a context-sensitive computation that can modify both the current context and the data passing through.
val peek : ('s -> 'a) -> ('a, 's) tpeek creates a context-sensitive computation that can look at the current context, but not modify it.
modify creates a context-sensitive computation that can look at and modify the current context.
val return : 'a -> ('a, 's) treturn lifts a value or monad into a stateful computation.
...as well as their runner functions...
include State_transform_types.Generic_runners
with type ('a, 's) t := ('a, 's) t
and type 'a final := 'a
and type 's state := 'sinclude State_transform_types.Generic_types
with type ('a, 's) t := ('a, 's) t
with type 'a final := 'a
with type 's state := 'sval run' : ('a, 's) t -> 's -> 's * 'arun' unfolds a t into a function from context to final state and result.
val run : ('a, 's) t -> 's -> 'arun unfolds a t into a function from context to final result. To get the final context, use run' or call peek at the end of the computation.
...and fixed-point combinators.
include State_transform_types.Fix with type ('a, 's) t := ('a, 's) t