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 :: Type -> Type) 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 #
newtype StateC s (m :: Type -> Type) a 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 | |
MonadIO m => MonadIO (StateC s m) Source # | |
Defined in Control.Carrier.State.Church | |
Alternative m => Alternative (StateC s m) Source # | |
Applicative (StateC s m) Source # | |
Defined in Control.Carrier.State.Church | |
Functor (StateC s m) Source # | |
Monad (StateC s m) Source # | |
(Alternative m, Monad m) => MonadPlus (StateC s m) Source # | |
MonadFail m => MonadFail (StateC s m) Source # | |
Defined in Control.Carrier.State.Church | |
MonadFix m => MonadFix (StateC s m) Source # | |
Defined in Control.Carrier.State.Church | |
Algebra sig m => Algebra (State s :+: sig) (StateC s m) Source # | |
State effect
module Control.Effect.State