Safe Haskell | Safe-Infered |
---|

Access helper functions in the State monad type family

- set :: MonadState m => T (StateType m) a -> a -> m ()
- get :: MonadState m => T (StateType m) a -> m a
- modify :: MonadState m => T (StateType m) a -> (a -> a) -> m ()
- getAndModify :: MonadState m => T (StateType m) a -> (a -> a) -> m a
- modifyAndGet :: MonadState m => T (StateType m) a -> (a -> a) -> m a
- (%=) :: MonadState m => T (StateType m) a -> a -> m ()
- (%:) :: MonadState m => T (StateType m) a -> (a -> a) -> m ()
- lift :: MonadState mr => T (StateType mr) s -> State s a -> mr a
- liftT :: (Monad m, MonadTrans t, MonadState (t m)) => T (StateType (t m)) s -> StateT s m a -> t m a

# accessors in the form of actions in the state monad

get :: MonadState m => T (StateType m) a -> m aSource

getAndModify :: MonadState m => T (StateType m) a -> (a -> a) -> m aSource

Modify a record element and return its old value.

modifyAndGet :: MonadState m => T (StateType m) a -> (a -> a) -> m aSource

Modify a record element and return its new value.

# lift a state monadic accessor to an accessor of a parent record

liftT :: (Monad m, MonadTrans t, MonadState (t m)) => T (StateType (t m)) s -> StateT s m a -> t m aSource