Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Control.Monad.Changeset.Class
Description
A type class generalising the API of ChangesetT
.
Synopsis
- class (Monad m, Monoid w, RightAction w s) => MonadChangeset s w m | m -> s, m -> w where
Documentation
class (Monad m, Monoid w, RightAction w s) => MonadChangeset s w m | m -> s, m -> w where Source #
Monads containing changeset state.
This usually implies that the ChangesetT
monad transformer is part of the monad transformer stack of m.
See its documentation for details.
Methods
Arguments
:: (s -> (a, w)) | Receives the current state and has to output a value and a change. |
-> m a |
Apply a changeset to the state.
Apply a change to the state.
The Action
instance is used to mutate the state.
Observe the current state.
Instances
(Monad m, Monad (t m), MonadTrans t, MFunctor t, MonadChangeset s w m) => MonadChangeset s w (t m) Source # | |
(RightAction w s, Monoid w, Monad m) => MonadChangeset s w (ChangesetT s w m) Source # | |
Defined in Control.Monad.Trans.Changeset Methods changeset :: (s -> (a, w)) -> ChangesetT s w m a Source # change :: w -> ChangesetT s w m () Source # current :: ChangesetT s w m s Source # |