Module DA.Action.State¶
DA.Action.State
Data Types¶
data State s a
A value of type
State s a
represents a computation that has access to a state variable of types
and produces a value of typea
.> > > runState (modify (+1)) 0 > > > ((), 1)
> > > evalState (modify (+1)) 0 > > > ()
> > > execState (modify (+1)) 0 > > > 1
Note that values of type
State s a
are not serializable.
Field Type Description runState s -> (a, s) instance Applicative (State s)