stdune
State.Make
stdune.filesystem_stubs
module S : sig ... end
module M : Monad.S
include Monad.S
type 'a t
val return : 'a -> 'a t
val bind : 'a t -> f:('a -> 'b t) -> 'b t
val map : 'a t -> f:('a -> 'b) -> 'b t
module O : sig ... end
val run : 'a t -> S.t -> (S.t * 'a) M.t
run t state runs computation t with state as the initial state. The final state and the computed result are returned
run t state
t
state
val get : S.t t
get returns the current state
get
val set : S.t -> unit t
set s sets the current state to s
set s
s
val lift : 'a M.t -> 'a t
lift m lifts m into the transformer
lift m
m
val modify : (S.t -> S.t) -> unit t
modify f lifts f into the monad. f is executed with the current state to produce a new state.
modify f
f