- Writer : Type -> Type -> Type
The `return` function produces the output `neutral`, while `>>=`
combines the outputs of the subcomputations using `<+>`.
Totality: total- record WriterT : Type -> (Type -> Type) -> Type -> Type
A writer monad parameterized by:
@w the output to accumulate.
@m The inner monad.
The `pure` function produces the output `neutral`, while `>>=`
combines the outputs of the subcomputations using `<+>`.
Totality: total
Constructor: - MkWriterT : (w -> m (a, w)) -> WriterT w m a
Projection: - .unWriterT : WriterT w m a -> w -> m (a, w)
- execWriter : Monoid w => Writer w a -> w
Extract the output from a writer computation.
Totality: total- execWriterT : (Functor m, Monoid w) => WriterT w m a -> m w
Extract the output from a writer computation.
Totality: total- mapWriter : (Monoid w, Semigroup w') => ((a, w) -> (b, w')) -> Writer w a -> Writer w' b
Map both the return value and output of a computation using
the given function.
Totality: total- mapWriterT : (Functor n, (Monoid w, Semigroup w')) => (m (a, w) -> n (b, w')) -> WriterT w m a -> WriterT w' n b
Map both the return value and output of a computation using
the given function.
Totality: total- runWriter : Monoid w => Writer w a -> (a, w)
Unwrap a writer computation as a (result, output) pair.
Totality: total- runWriterT : Monoid w => WriterT w m a -> m (a, w)
Unwrap a writer computation.
(The inverse of 'writerT'.)
Totality: total- writerT : (Functor m, Semigroup w) => m (a, w) -> WriterT w m a
Construct an writer computation from a (result,output) computation.
(The inverse of `runWriterT`.)
Totality: total