Safe Haskell | None |
---|---|
Language | Haskell2010 |
- class Monad m => MonadState tag s m | m tag -> s where
- modify :: MonadState tag s m => proxy tag -> (s -> s) -> m ()
- gets :: MonadState tag s m => proxy tag -> (s -> a) -> m a
Documentation
class Monad m => MonadState tag s m | m tag -> s where Source #
See MonadState
.
get :: proxy tag -> m s Source #
Return the state from the internals of the monad.
put :: proxy tag -> s -> m () Source #
Replace the state inside the monad.
state :: proxy tag -> (s -> (a, s)) -> m a Source #
Embed a simple state action into the monad.
(MonadTrans t, Monad (t m), MonadState k tag s m) => MonadState k tag s (t m) Source # | |
(Monad m, (~) * s s') => MonadState k tag s (StateT k tag s' m) Source # | |
(Monad m, (~) * s s') => MonadState k tag s (StateT k tag s' m) Source # | |
modify :: MonadState tag s m => proxy tag -> (s -> s) -> m () Source #
Modifies the state inside a state monad.
gets :: MonadState tag s m => proxy tag -> (s -> a) -> m a Source #
Gets specific component of the state, using a projection function supplied.