Safe Haskell | Safe-Inferred |
---|---|

Language | Haskell2010 |

## Synopsis

- newtype StateT s m a = StateT (s -> m (a, s))
- runStateT :: StateT s m a -> s -> m (a, s)
- evalStateT :: Functor m => StateT s m a -> s -> m a
- execStateT :: Functor m => StateT s m a -> s -> m s
- mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b
- withStateT :: (s -> s) -> StateT s m a -> StateT s m a
- liftStateT :: Functor m => m a -> StateT s m a
- type State s = StateT s Identity
- runState :: State s a -> s -> (a, s)
- evalState :: State s a -> s -> a
- execState :: State s a -> s -> s
- mapState :: ((a, s) -> (b, s)) -> State s a -> State s b
- withState :: (s -> s) -> State s a -> State s a
- get :: Applicative m => StateT s m s
- put :: Applicative m => s -> StateT s m ()
- state :: Applicative m => (s -> (a, s)) -> StateT s m a
- gets :: Applicative m => (s -> a) -> StateT s m a
- modify :: Applicative m => (s -> s) -> StateT s m ()

# Monad Transformer

StateT (s -> m (a, s)) |

#### Instances

MonadFix m => MonadRevState s (StateT s m) Source # | |

MonadFix m => MonadFix (StateT s m) Source # | |

Defined in Control.Monad.Trans.RevState | |

MonadFix m => Applicative (StateT s m) Source # | |

Defined in Control.Monad.Trans.RevState | |

Functor m => Functor (StateT s m) Source # | |

MonadFix m => Monad (StateT s m) Source # | |

evalStateT :: Functor m => StateT s m a -> s -> m a Source #

execStateT :: Functor m => StateT s m a -> s -> m s Source #

withStateT :: (s -> s) -> StateT s m a -> StateT s m a Source #

liftStateT :: Functor m => m a -> StateT s m a Source #

# Monad

# Primitives and basic combinators

get :: Applicative m => StateT s m s Source #

put :: Applicative m => s -> StateT s m () Source #

state :: Applicative m => (s -> (a, s)) -> StateT s m a Source #

gets :: Applicative m => (s -> a) -> StateT s m a Source #

modify :: Applicative m => (s -> s) -> StateT s m () Source #