ghc-lib-8.8.1.20191204: The GHC API, decoupled from GHC versions

Safe HaskellSafe
LanguageHaskell2010

State

Documentation

newtype State s a Source #

Constructors

State 

Fields

Instances
Monad (State s) Source # 
Instance details

Defined in State

Methods

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

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

return :: a -> State s a #

fail :: String -> State s a #

Functor (State s) Source # 
Instance details

Defined in State

Methods

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

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

Applicative (State s) Source # 
Instance details

Defined in State

Methods

pure :: a -> State s a #

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

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

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

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

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 #