Copyright | C. Maeder and Uni Bremen 2002-2005 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | Christian.Maeder@dfki.de |
Stability | experimental |
Portability | portable |
Safe Haskell | Safe-Inferred |
State type from Control.Monad.State but no class MonadState
This module was a replacement of the (non-haskell98) module Control.Monad.State, but now Control.Monad.Trans.State can be used instead.
- newtype State s a = State {
- runState :: s -> (a, s)
- state :: (s -> (a, s)) -> State s a
- get :: State s s
- put :: s -> State s ()
- modify :: (s -> s) -> State s ()
- gets :: (s -> a) -> State s a
- 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
Documentation
newtype State s a
Our fixed state monad