Safe Haskell | None |
---|---|
Language | Haskell2010 |
- type MonadState s = MonadState s s
- get :: forall s m. MonadState s m => m s
- put :: forall s m. MonadState s m => s -> m ()
- state :: forall s m a. MonadState s m => (s -> (a, s)) -> m a
- modify :: forall s m. MonadState s m => (s -> s) -> m ()
- gets :: forall s m a. MonadState s m => (s -> a) -> m a
- type State s = State s s
- runState :: State s a -> s -> (a, s)
- evalState :: State s a -> s -> a
- execState :: State s a -> s -> s
- type StateT s = StateT s s
- stateT :: (s -> m (a, s)) -> StateT s m a
- runStateT :: StateT s m a -> s -> m (a, s)
- evalStateT :: Monad m => StateT s m a -> s -> m a
- execStateT :: Monad m => StateT s m a -> s -> m s
MonadState class
type MonadState s = MonadState s s Source
See MonadState
.
get :: forall s m. MonadState s m => m s Source
See get
.
put :: forall s m. MonadState s m => s -> m () Source
See put
.
state :: forall s m a. MonadState s m => (s -> (a, s)) -> m a Source
See state
.
modify :: forall s m. MonadState s m => (s -> s) -> m () Source
See modify
.
gets :: forall s m a. MonadState s m => (s -> a) -> m a Source
See gets
.
The State monad
The StateT monad transformer
evalStateT :: Monad m => StateT s m a -> s -> m a Source
See evalStateT
.
execStateT :: Monad m => StateT s m a -> s -> m s Source
See execStateT
.