|
Control.Monad.State | Portability | non-portable ( mulit-param classes, functional dependencies ) | Stability | experimental | Maintainer | libraries@haskell.org |
|
|
|
|
|
Description |
State monads. Inspired by the paper
Functional Programming with Overloading and
Higher-Order Polymorphism,
Mark P Jones (http://www.cse.ogi.edu/~mpj)
Advanced School of Functional Programming, 1995. |
|
|
|
class (Monad m) => MonadState s m | m -> s where |
| Methods | put :: s -> m () | | get :: m s |
| | Instances | |
|
|
modify :: (MonadState s m) => (s -> s) -> m () |
|
gets :: (MonadState s m) => (s -> a) -> m a |
|
data State s a |
Constructors | State | | runState :: (s -> (a, s)) | |
|
| Instances | |
|
|
runState :: State s a -> s -> (a, s) |
|
evalState :: State s a -> s -> a |
|
execState :: State s a -> s -> s |
|
mapState :: ((a, s) -> (b, s)) -> State s a -> State s b |
|
withState :: (s -> s) -> State s a -> State s a |
|
data StateT s m a |
Constructors | StateT | | runStateT :: (s -> m (a, s)) | |
|
| Instances | |
|
|
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 |
|
mapStateT :: (m (a, s) -> n (b, s)) -> StateT s m a -> StateT s n b |
|
withStateT :: (s -> s) -> StateT s m a -> StateT s m a |
|
module Control.Monad |
|
module Control.Monad.Fix |
|
module Control.Monad.Trans |
|
Produced by Haddock version 0.3 |