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)
History
Added
3.4.9