| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Control.Monad.State.Persistent
- data PersistentStateT s m a
- type PersistentState s = PersistentStateT s Identity
- store :: Monad m => PersistentStateT s m ()
- runPersistentStateT :: Functor m => PersistentStateT s m a -> s -> m (a, s, [s])
- runPersistentState :: PersistentState s a -> s -> (a, s, [s])
Documentation
data PersistentStateT s m a Source
A State monad that can store earlier versions of the state.
Instances
| Monad m => MonadState s (PersistentStateT s m) Source | |
| Monad m => Monad (PersistentStateT s m) Source | |
| Functor m => Functor (PersistentStateT s m) Source | |
| Monad m => Applicative (PersistentStateT s m) Source |
type PersistentState s = PersistentStateT s Identity Source
store :: Monad m => PersistentStateT s m () Source
Create a snapshot of the current state and add it to the list of states that we store.
runPersistentStateT :: Functor m => PersistentStateT s m a -> s -> m (a, s, [s]) Source
run a persistentStateT, returns a triplet with the value, the last state and a list of all states (including the last one) in chronological order
runPersistentState :: PersistentState s a -> s -> (a, s, [s]) Source