State

ghc-7.10.2: The GHC API

Safe Haskell | Safe
Language | Haskell2010

State

# Documentation

newtype State s a Source

Constructors

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

Instances

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

get :: State s s Source

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

put :: s -> State s () Source

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

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

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

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