IdrisDoc: Control.Monad.State

Control.Monad.State

runState : StateT stateType Identity a -> stateType -> (a, stateType)

Unwrap a State monad computation.

modify : MonadState stateType m => (stateType -> stateType) -> m ()

Apply a function to modify the context of this computation

gets : MonadState stateType m => (stateType -> a) -> m a

Evaluate a function in the context held by this computation

execState : State stateType a -> stateType -> stateType

Unwrap a State monad computation, but discard the resulting value.

evalState : State stateType a -> stateType -> a

Unwrap a State monad computation, but discard the final state.

record StateT stateType m a

The transformer on which the State monad is based

stateType
 
m
 
a
 
ST : (runStateT : stateType -> m (a, stateType)) -> StateT stateType m a
runStateT : (rec : StateT stateType m a) -> stateType -> m (a, stateType)
State : (stateType : Type) -> (ty : Type) -> Type

The State monad. See the MonadState interface

ST : (runStateT : stateType -> m (a, stateType)) -> StateT stateType m a
interface MonadState 

A computation which runs in a context and produces an output

get : MonadState stateType m => m stateType

Get the context

put : MonadState stateType m => stateType -> m ()

Write a new context/output