type RWS r w s = RWST r w s Identity { } #
newtype RWST r w s m a { } #
RWST { runRWST :: r -> s -> m (a, s, w) }
A monad transformer containing an environment of type @r@,
rws :: (r -> s -> (a, s, w)) -> RWS r w s a { } #
Construct an RWS from a function.
runRWS :: (RWS r w s a) -> r -> s -> (a, s, w) { } #
Run an RWS.
evalRWS :: (RWS r w s a) -> r -> s -> (a, w) { } #
Evaluate an RWS, returning only the result.
execRWS :: (RWS r w s a) -> r -> s -> (s, w) { } #
Execute an RWS, returning only the final state and output.
mapRWS :: ((a, s, w) -> (b, s, w')) -> (RWS r w s a) -> RWS r w' s b { } #
Map the return value, final state, and output of an RWS.
withRWS :: (r' -> s -> (r, s)) -> (RWS r w s a) -> RWS r' w s a { } #
Execute an RWS with a modified environment.
<*> :: { } #
>>= :: { } #
evalRWST :: (Monad m) => (RWST r w s m a) -> r -> s -> m (a, w) { } #
Evaluate an RWST, returning only the result and output.
execRWST :: (Monad m) => (RWST r w s m a) -> r -> s -> m (s, w) { } #
Execute an RWST, returning only the final state and output.
mapRWST :: ((m (a, s, w)) -> n (b, s, w')) -> (RWST r w s m a) -> RWST r w' s n b { } #
Map the inner computation.
withRWST :: (r' -> s -> (r, s)) -> (RWST r w s m a) -> RWST r' w s m a { } #
Execute with a modified environment and state.
ask :: (Monad m) => RWST r w s m r { } #
Fetch the environment.
local :: (r -> r) -> (RWST r w s m a) -> RWST r w s m a { } #
Execute with a modified environment.
asks :: (Monad m) => (r -> a) -> RWST r w s m a { } #
Fetch a function of the environment.
reader :: (Monad m) => (r -> a) -> RWST r w s m a { } #
Create a reader computation.
tell :: (Monad m) => w -> RWST r w s m () { } #
Append to the output.
listen :: (Monad m) => (RWST r w s m a) -> RWST r w s m (a, w) { } #
Execute and collect the output.
listens :: (Monad m) => (w -> b) -> (RWST r w s m a) -> RWST r w s m (a, b) { } #
Execute and apply a function to the output.
pass :: (Monad m) => (RWST r w s m (a, w -> w)) -> RWST r w s m a { } #
Execute with a function that can modify output.
censor :: (Monad m) => (w -> w) -> (RWST r w s m a) -> RWST r w s m a { } #
Apply a function to the output.
writer :: (Monad m) => (a, w) -> RWST r w s m a { } #
Create a writer computation.
get :: (Monad m) => RWST r w s m s { } #
Fetch the current state.
put :: (Monad m) => s -> RWST r w s m () { } #
Set the state.
modify :: (Monad m) => (s -> s) -> RWST r w s m () { } #
Modify the state.
modify' :: (Monad m) => (s -> s) -> RWST r w s m () { } #
Strict modify.
gets :: (Monad m) => (s -> a) -> RWST r w s m a { } #
Get a function of the state.
state :: (Monad m) => (s -> (a, s)) -> RWST r w s m a { } #
Create a state computation.
instance Functor m => Functor (RWST r w s m) { }
instance Monoid w => MonadTrans (RWST r w s) { }
instance Monoid w, MonadIO m => MonadIO (RWST r w s m) { }