Module

Control.Monad.Transformerless.State

Package
purescript-transformerless
Repository
thimoteus/purescript-transformerless

#State Source

newtype State s a

Constructors

Instances

#runState Source

runState :: forall a s. State s a -> s -> Tuple a s

#evalState Source

evalState :: forall a s. State s a -> s -> a

#execState Source

execState :: forall a s. State s a -> s -> s

#mapState Source

mapState :: forall b a s. (Tuple a s -> Tuple b s) -> State s a -> State s b

#mapS Source

mapS :: forall b a s. (a -> b) -> State s a -> State s b

#(|->) Source

Operator alias for Control.Monad.Transformerless.State.mapS (left-associative / precedence 4)

#applyS Source

applyS :: forall b a s. State s (a -> b) -> State s a -> State s b

#(~) Source

Operator alias for Control.Monad.Transformerless.State.applyS (left-associative / precedence 4)

#pureS Source

pureS :: forall a s. a -> State s a

#bindS Source

bindS :: forall b a s. State s a -> (a -> State s b) -> State s b

#(>>-) Source

Operator alias for Control.Monad.Transformerless.State.bindS (left-associative / precedence 1)

#deferS Source

deferS :: forall a s. (Unit -> State s a) -> State s a

#tailRecS Source

tailRecS :: forall b a s. (a -> State s (Step a b)) -> a -> State s b

#get Source

get :: forall s. State s s

#gets Source

gets :: forall a s. (s -> a) -> State s a

#put Source

put :: forall s. s -> State s Unit

#modify Source

modify :: forall s. (s -> s) -> State s Unit