State_transform.Make2SourceMake2 makes an S2 (state transformer with variable state type) from a Monad.S.
module M : Base.Monad.Sinclude Base.Monad.S2Same as Infix, except the monad type has two arguments. The second is always just passed through.
include State_transform_types.Generic
with type ('a, 's) t := ('a, 's) t
and type 's state := 's
with module Inner = Minclude State_transform_types.Generic_builders
with type 'a final := 'a
with type ('a, 's) t := ('a, 's) t
with type 's state := 'sinclude State_transform_types.Generic_types
with type 'a final := 'a
with type ('a, 's) t := ('a, 's) t
with type 's state := 'smake creates a context-sensitive computation that can modify both the current context and the data passing through.
peek 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.
State transformers have the same runner signatures as state monads, but lifted into the inner monad.
include State_transform_types.Fix with type ('a, 's) t := ('a, 's) tfix ~f init builds a fixed point on f.
At each step, f is passed a continuation mu and a value a. It may choose to return a recursive application of mu, or some value derived from a.
To begin with, f is applied to mu and init.