Module

Control.Monad.Transformerless.RWS

Package
purescript-transformerless
Repository
thimoteus/purescript-transformerless

#RWS Source

newtype RWS r w s a

Constructors

Instances

#RWSResult Source

data RWSResult s a w

Constructors

#runRWS Source

runRWS :: forall a s w r. RWS r w s a -> r -> s -> RWSResult s a w

#evalRWS Source

evalRWS :: forall a s w r. RWS r w s a -> r -> s -> Tuple a w

#execRWS Source

execRWS :: forall a s w r. RWS r w s a -> r -> s -> Tuple s w

#mapRWS Source

mapRWS :: forall a2 a1 s w2 w1 r. (RWSResult s a1 w1 -> RWSResult s a2 w2) -> RWS r w1 s a1 -> RWS r w2 s a2

#withRWS Source

withRWS :: forall a s w r2 r1. (r2 -> s -> Tuple r1 s) -> RWS r1 w s a -> RWS r2 w s a

#map_ Source

map_ :: forall b a s w r. (a -> b) -> RWS r w s a -> RWS r w s b

#(|->) Source

Operator alias for Control.Monad.Transformerless.RWS.map_ (left-associative / precedence 4)

#apply_ Source

apply_ :: forall b a s w r. Semigroup w => RWS r w s (a -> b) -> RWS r w s a -> RWS r w s b

#(~) Source

Operator alias for Control.Monad.Transformerless.RWS.apply_ (left-associative / precedence 4)

#pure_ Source

pure_ :: forall a s w r. Monoid w => a -> RWS r w s a

#bind_ Source

bind_ :: forall b a s w r. Semigroup w => RWS r w s a -> (a -> RWS r w s b) -> RWS r w s b

#(>>-) Source

Operator alias for Control.Monad.Transformerless.RWS.bind_ (left-associative / precedence 1)

#tailRec_ Source

tailRec_ :: forall b a s w r. Monoid w => (a -> RWS r w s (Step a b)) -> a -> RWS r w s b

#reader Source

reader :: forall a s w r. Monoid w => (r -> a) -> RWS r w s a

Reader

#ask Source

ask :: forall s w r. Monoid w => RWS r w s r

#local Source

local :: forall a s w r. (r -> r) -> RWS r w s a -> RWS r w s a

#writer Source

writer :: forall a s w r. Tuple a w -> RWS r w s a

Writer

#listen Source

listen :: forall a s w r. RWS r w s a -> RWS r w s (Tuple a w)

#pass Source

pass :: forall a s w r. RWS r w s (Tuple a (w -> w)) -> RWS r w s a

#tell Source

tell :: forall s w r. w -> RWS r w s Unit

#listens Source

listens :: forall b a s w r. (w -> b) -> RWS r w s a -> RWS r w s (Tuple a b)

#censor Source

censor :: forall a s w r. Monoid w => (w -> w) -> RWS r w s a -> RWS r w s a

#state Source

state :: forall a s w r. Monoid w => (s -> Tuple a s) -> RWS r w s a

State

#get Source

get :: forall s w r. Monoid w => RWS r w s s

#gets Source

gets :: forall a s w r. Monoid w => (s -> a) -> RWS r w s a

#put Source

put :: forall s w r. Monoid w => s -> RWS r w s Unit

#modify Source

modify :: forall s w r. Monoid w => (s -> s) -> RWS r w s Unit