Safe Haskell | None |
---|---|
Language | Haskell2010 |
A church-encoded carrier for the State
effect.
Note that the parameter order in runState
, evalState
, and execState
is reversed compared the equivalent functions provided by transformers
. This is an intentional decision made to enable the composition of effect handlers with .
without invoking flip
.
Since: 1.1.0.0
Synopsis
- runState :: forall s m a b. (s -> a -> m b) -> s -> StateC s m a -> m b
- evalState :: forall s m a. Applicative m => s -> StateC s m a -> m a
- execState :: forall s m a. Applicative m => s -> StateC s m a -> m s
- newtype StateC s m a = StateC (forall r. (s -> a -> m r) -> s -> m r)
- module Control.Effect.State
State carrier
evalState :: forall s m a. Applicative m => s -> StateC s m a -> m a Source #
execState :: forall s m a. Applicative m => s -> StateC s m a -> m s Source #
Since: 1.1.0.0
StateC (forall r. (s -> a -> m r) -> s -> m r) |
Instances
MonadTrans (StateC s) Source # | |
Defined in Control.Carrier.State.Church | |
Monad (StateC s m) Source # | |
Functor (StateC s m) Source # | |
MonadFix m => MonadFix (StateC s m) Source # | |
Defined in Control.Carrier.State.Church | |
MonadFail m => MonadFail (StateC s m) Source # | |
Defined in Control.Carrier.State.Church | |
Applicative (StateC s m) Source # | |
Defined in Control.Carrier.State.Church | |
MonadIO m => MonadIO (StateC s m) Source # | |
Defined in Control.Carrier.State.Church | |
Alternative m => Alternative (StateC s m) Source # | |
(Alternative m, Monad m) => MonadPlus (StateC s m) Source # | |
Algebra sig m => Algebra (State s :+: sig) (StateC s m) Source # | |
State effect
module Control.Effect.State