State

ghc-7.10.3: The GHC API

Safe Haskell | Safe
Language | Haskell2010

State

# Documentation

newtype State s a

Constructors

State |
Fields runState' :: s -> (#a, s#)

Instances

Monad (State s) |
Functor (State s) |
Applicative (State s) |

get :: State s s

gets :: (s -> a) -> State s a

put :: s -> State s ()

modify :: (s -> s) -> State s ()

evalState :: State s a -> s -> a

execState :: State s a -> s -> s

runState :: State s a -> s -> (a, s)