extensible-effects-1.2.0: An Alternative to Monad Transformers
Control.Eff.State.Lazy
Description
Lazy state effect
Synopsis
data State s w Source
Strict state effect
Instances
get :: (Typeable e, Member (State e) r) => Eff r eSource
Return the current value of the state.
put :: (Typeable e, Member (State e) r) => e -> Eff r ()Source
Write a new value of the state.
modify :: (Typeable s, Member (State s) r) => (s -> s) -> Eff r ()Source
Transform the state with a function.
runStateSource
Arguments
Initial state
Effect incorporating State
Effect containing final state and a return value
Run a State effect.