- RWS : Type -> Type -> Type -> Type -> Type
A monad containing an environment of type `r`, output of type `w`
and an updatable state of type `s`.
Totality: total- record RWST : Type -> Type -> Type -> (Type -> Type) -> Type -> Type
A monad transformer adding reading an environment of type `r`,
collecting an output of type `w` and updating a state of type `s`
to an inner monad `m`.
Totality: total
Constructor: - MkRWST : (r -> s -> w -> m (a, (s, w))) -> RWST r w s m a
Projection: - .unRWST : RWST r w s m a -> r -> s -> w -> m (a, (s, w))
- evalRWS : Monoid w => RWS r w s a -> r -> s -> (a, w)
Evaluate a computation with the given initial state and environment,
returning the final value and output, discarding the final state.
Totality: total- evalRWST : (Functor m, Monoid w) => RWST r w s m a -> r -> s -> m (a, w)
Evaluate a computation with the given initial state and environment,
returning the final value and output, discarding the final state.
Totality: total- execRWS : Monoid w => RWS r w s a -> r -> s -> (s, w)
Evaluate a computation with the given initial state and environment,
returning the final state and output, discarding the final value.
Totality: total- execRWST : (Functor m, Monoid w) => RWST r w s m a -> r -> s -> m (s, w)
Evaluate a computation with the given initial state and environment,
returning the final state and output, discarding the final value.
Totality: total- mapRWS : (Monoid w, Semigroup w') => ((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 a computation using
the given function.
Totality: total- mapRWST : (Functor n, (Monoid w, Semigroup w')) => (m (a, (s, w)) -> n (b, (s, w'))) -> RWST r w s m a -> RWST r w' s n b
Map the inner computation using the given function.
Totality: total- runRWS : Monoid w => RWS r w s a -> r -> s -> (a, (s, w))
Unwrap an RWS computation as a function. (The inverse of `rws`.)
Totality: total- runRWST : Monoid w => RWST r w s m a -> r -> s -> m (a, (s, w))
Unwrap an RWST computation as a function. (The inverse of `rwsT`.)
Totality: total- rws : Semigroup w => (r -> s -> (a, (s, w))) -> RWS r w s a
Construct an RWS computation from a function. (The inverse of `runRWS`.)
Totality: total- rwsT : (Functor m, Semigroup w) => (r -> s -> m (a, (s, w))) -> RWST r w s m a
Construct an RWST computation from a function. (The inverse of `runRWST`.)
Totality: total- withRWS : (r' -> s -> (r, s)) -> RWS r w s a -> RWS r' w s a
`withRWS f m` executes action `m` with an initial environment
and state modified by applying `f`.
Totality: total- withRWST : (r' -> s -> (r, s)) -> RWST r w s m a -> RWST r' w s m a
`withRWST f m` executes action `m` with an initial environment
and state modified by applying `f`.
Totality: total