ghc-6.12.2: The GHC APISource codeContentsIndex
State
Synopsis
newtype State s a = State {
runState' :: s -> (#a, 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)
mapAccumLM :: Monad m => (acc -> x -> m (acc, y)) -> acc -> [x] -> m (acc, [y])
Documentation
newtype State s a Source
Constructors
State
runState' :: s -> (#a, s#)
show/hide Instances
get :: State s sSource
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
:: Monad m
=> acc -> x -> m (acc, y)combining funcction
-> accinitial state
-> [x]inputs
-> m (acc, [y])final state, outputs
Monadic version of mapAccumL
Produced by Haddock version 2.6.1