Hoogle Search
Within LTS Haskell 24.4 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
execStateT :: Monad m => StateT s m a -> s -> m smonads-tf Control.Monad.State.Lazy Evaluate a state computation with the given initial state and return the final state, discarding the final value.
execStateT m s = liftM snd (runStateT m s)
mapState :: ((a, s) -> (b, s)) -> State s a -> State s bmonads-tf Control.Monad.State.Lazy Map both the return value and final state of a computation using the given function.
mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n bmonads-tf Control.Monad.State.Lazy Map both the return value and final state of a computation using the given function.
runState :: State s a -> s -> (a, s)monads-tf Control.Monad.State.Lazy Unwrap a state monad computation as a function. (The inverse of state.)
runStateT :: StateT s (m :: Type -> Type) a -> s -> m (a, s)monads-tf Control.Monad.State.Lazy No documentation available.
withState :: (s -> s) -> State s a -> State s amonads-tf Control.Monad.State.Lazy withState f m executes action m on a state modified by applying f.
withStateT :: forall s (m :: Type -> Type) a . (s -> s) -> StateT s m a -> StateT s m amonads-tf Control.Monad.State.Lazy withStateT f m executes action m on a state modified by applying f.
withStateT f m = modify f >> m
class Monad m =>
MonadState (m :: Type -> Type)monads-tf Control.Monad.State.Strict get returns the state from the internals of the monad. put replaces the state inside the monad.
evalState :: State s a -> s -> amonads-tf Control.Monad.State.Strict Evaluate a state computation with the given initial state and return the final value, discarding the final state.
evalStateT :: Monad m => StateT s m a -> s -> m amonads-tf Control.Monad.State.Strict Evaluate a state computation with the given initial state and return the final value, discarding the final state.
evalStateT m s = liftM fst (runStateT m s)