ghc-7.8.20140130: The GHC API

Safe HaskellSafe-Inferred
LanguageHaskell98

State

Synopsis

Documentation

newtype State s aSource

Constructors

State 

Fields

runState' :: s -> (#a, s#)
 

Instances

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

put :: s -> State s ()Source

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

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

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

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

mapAccumLMSource

Arguments

:: Monad m 
=> (acc -> x -> m (acc, y))

combining funcction

-> acc

initial state

-> [x]

inputs

-> m (acc, [y])

final state, outputs

Monadic version of mapAccumL