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.
mapState :: ((a, s) -> (b, s)) -> State s a -> State s btransformers Control.Monad.Trans.State.Strict 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 btransformers Control.Monad.Trans.State.Strict Map both the return value and final state of a computation using the given function.
runState :: State s a -> s -> (a, s)transformers Control.Monad.Trans.State.Strict Unwrap a state monad computation as a function. (The inverse of state.)
runStateT :: StateT s (m :: Type -> Type) a -> s -> m (a, s)transformers Control.Monad.Trans.State.Strict No documentation available.
withState :: (s -> s) -> State s a -> State s atransformers Control.Monad.Trans.State.Strict 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 atransformers Control.Monad.Trans.State.Strict withStateT f m executes action m on a state modified by applying f.
withStateT f m = modify f >> m
class Monad m =>
MonadState s (m :: Type -> Type) | m -> smtl Control.Monad.State.Class Minimal definition is either both of get and put or just state
class Monad m =>
MonadState s (m :: Type -> Type) | m -> smtl Control.Monad.State.Lazy Minimal definition is either both of get and put or just state
evalState :: State s a -> s -> amtl Control.Monad.State.Lazy 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 amtl Control.Monad.State.Lazy 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)