Hoogle Search
Within LTS Haskell 24.9 (ghc-9.10.2)
Note that Stackage only displays results for the latest LTS and Nightly snapshot. Learn more.
mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n bmonadology Control.Monad.Ology.Specific.StateT Map both the return value and final state of a computation using the given function.
runState :: State s a -> s -> (a, s)monadology Control.Monad.Ology.Specific.StateT Unwrap a state monad computation as a function. (The inverse of state.)
runStateT :: StateT s (m :: Type -> Type) a -> s -> m (a, s)monadology Control.Monad.Ology.Specific.StateT No documentation available.
withState :: (s -> s) -> State s a -> State s amonadology Control.Monad.Ology.Specific.StateT 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 amonadology Control.Monad.Ology.Specific.StateT withStateT f m executes action m on a state modified by applying f.
withStateT f m = modify f >> m
newtype
ChangingState (m :: Type -> Type) st aparameterized Parameterized.Control.Monad.Trans.State.Strict Given a ChangingState that changes state from s to t, and another ChangingState that changes state from t to u make a State that changes from s to u with the compile time constraint that all the types in (AppendUnique a b) are distinct. NB. The state is in the snd position to be consistent with StateT.
ChangingState :: (At0 st -> m (a, At1 st)) -> ChangingState (m :: Type -> Type) st aparameterized Parameterized.Control.Monad.Trans.State.Strict No documentation available.
newtype
ManyState (m :: Type -> Type) s aparameterized Parameterized.Control.Monad.Trans.State.Strict Given a ManyState that modifies Many a, and another ManyState that modifes Many b make a State that accepts Many (AppendUnique a b) with the compile time constraint that all the types in (AppendUnique a b) are distinct.
ManyState :: StateT s m a -> ManyState (m :: Type -> Type) s aparameterized Parameterized.Control.Monad.Trans.State.Strict No documentation available.
changingState :: (s -> m (a, t)) -> ChangingState m (s, t) aparameterized Parameterized.Control.Monad.Trans.State.Strict Prefer this to using ChangingState to construct as it results in better type inference as it avoids ambiguous type variable st