ghc-8.4.0.20180118: The GHC API

Safe HaskellSafe
LanguageHaskell2010

State

Documentation

newtype State s a Source #

Constructors

State 

Fields

Instances
Monad (State s) # 
Instance details

Methods

(>>=) :: State s a -> (a -> State s b) -> State s b Source #

(>>) :: State s a -> State s b -> State s b Source #

return :: a -> State s a Source #

fail :: String -> State s a Source #

Functor (State s) # 
Instance details

Methods

fmap :: (a -> b) -> State s a -> State s b Source #

(<$) :: a -> State s b -> State s a Source #

Applicative (State s) # 
Instance details

Methods

pure :: a -> State s a Source #

(<*>) :: State s (a -> b) -> State s a -> State s b Source #

liftA2 :: (a -> b -> c) -> State s a -> State s b -> State s c Source #

(*>) :: State s a -> State s b -> State s b Source #

(<*) :: State s a -> State s b -> State s a Source #

get :: State s s Source #

get :: State s s Source #

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

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

put :: s -> State s () Source #

put :: s -> State s () Source #

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

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

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

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

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

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

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

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