rev-state-0.1.2: Reverse State monad transformer

Safe HaskellSafe
LanguageHaskell98

Control.Monad.Trans.RevState

Contents

Synopsis

Monad Transformer

newtype StateT s m a Source

Constructors

StateT 

Fields

runStateT :: s -> m (a, s)
 

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

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

mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b Source

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

Monad

runState :: State s a -> s -> (a, s) Source

evalState :: State s a -> s -> a Source

execState :: State s a -> s -> s Source

mapState :: ((a, s) -> (b, s)) -> State s a -> State s b Source

withState :: (s -> s) -> State s a -> State s a Source

Primitives and basic combinators

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