interface MonadWriter : Type -> (Type -> Type) -> Type
MonadWriter interface
tell is like tell on the MUD's it shouts to monad
what you want to be heard. The monad carries this 'packet'
upwards, merging it if needed (hence the Monoid requirement).
listen listens to a monad acting, and returns what the monad "said".
pass lets you provide a writer transformer which changes internals of
the written object.
Parameters: w, m
Constraints: Monoid w, Monad m
Methods:
writer : (a, w) -> m a
`writer (a,w)` embeds a simple writer action.
tell : w -> m ()
`tell w` is an action that produces the output `w`.
listen : m a -> m (a, w)
`listen m` is an action that executes the action `m` and adds
its output to the value of the computation.
pass : m (a, w -> w) -> m a
`pass m` is an action that executes the action `m`, which
returns a value and a function, and returns the value, applying
the function to the output.
Implementations:
(Monoid w, Monad m) => MonadWriter w (WriterT w m)
(Monoid w, Monad m) => MonadWriter w (RWST r w s m)
MonadWriter w m => MonadWriter w (EitherT e m)
MonadWriter w m => MonadWriter w (MaybeT m)
MonadWriter w m => MonadWriter w (ReaderT r m)
MonadWriter w m => MonadWriter w (StateT s m)
writer : MonadWriter w m => (a, w) -> m a
`writer (a,w)` embeds a simple writer action.
Totality: total
Visibility: public exporttell : MonadWriter w m => w -> m ()
`tell w` is an action that produces the output `w`.
Totality: total
Visibility: public exportlisten : MonadWriter w m => m a -> m (a, w)
`listen m` is an action that executes the action `m` and adds
its output to the value of the computation.
Totality: total
Visibility: public exportpass : MonadWriter w m => m (a, w -> w) -> m a
`pass m` is an action that executes the action `m`, which
returns a value and a function, and returns the value, applying
the function to the output.
Totality: total
Visibility: public exportlistens : MonadWriter w m => (w -> b) -> m a -> m (a, b)
`listens f m` is an action that executes the action `m` and adds
the result of applying @f@ to the output to the value of the computation.
Totality: total
Visibility: public exportcensor : MonadWriter w m => (w -> w) -> m a -> m a
`censor f m` is an action that executes the action `m` and
applies the function `f` to its output, leaving the return value
unchanged.
Totality: total
Visibility: public export