Idris2Doc : Control.Monad.State.Interface

Control.Monad.State.Interface

MonadState : Type -> (Type -> Type) -> Type
A computation which runs in a context and produces an output
Parameters: stateType, m
Constraints: Monad m
Methods:
get : mstateType
Get the context
put : stateType -> m _
Write a new context/output
state : (stateType -> _) -> ma
Embed a simple state action into the monad.

Implementations:
Monadm => MonadStatestateType (StateTstateTypem)
MonadStatesm => MonadStates (EitherTem)
MonadStatesm => MonadStates (MaybeTm)
Monadm => MonadStates (RWSTrwsm)
MonadStatesm => MonadStates (ReaderTrm)
MonadStatesm => MonadStates (WriterTrm)
get : MonadStatestateTypem => mstateType
Get the context
gets : MonadStatestateTypem => (stateType -> a) -> ma
Evaluate a function in the context held by this computation
modify : MonadStatestateTypem => (stateType -> stateType) -> mUnit
Apply a function to modify the context of this computation
put : MonadStatestateTypem => stateType -> mUnit
Write a new context/output
state : MonadStatestateTypem => (stateType -> (stateType, a)) -> ma
Embed a simple state action into the monad.