DA.Action.State.Class
DA.Action.State.ClassModule Snapshot
Lifecycle
Stable.
Notices
Status:
active
Introduced in: 3.4.9
Removed in: -
Warnings: 0
Deprecations: 0
Deprecated since: -Typeclasses
class ActionState s m
Action m has a state variable of type s.
Rules:
get *> ma = mama <* get = maput a >>= get = put a $> aput a *> put b = put b(,) <$> get <*> get = get <&> \a -> (a, a)
get:msFetch the current value of the state variable.put:s->m() Set the value of the state variable.modify: (s->s) ->m() Modify the state variable with the given function.modify:Actionm=> (s->s) ->m()
- instance
ActionStates(States)