Safe Haskell | Safe |
---|---|
Language | Haskell98 |
- newtype StateT s m a = StateT {
- runStateT :: 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
- 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
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
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