type Writer w = WriterT w Identity { } #
newtype WriterT w m a { } #
WriterT { runWriterT :: m (a, w) }
The writer monad transformer.
class Monoid w, Monad m => MonadWriter w m { } #

Methods

tellW :: w -> m ()
listenW :: (m a) -> m (a, w)
passW :: (m (a, w -> w)) -> m a
Class for monads that can write.
runWriter :: (Writer w a) -> (a, w) { } #
Run a Writer.
execWriter :: (Writer w a) -> w { } #
Run and return only the output.
mapWriter :: ((a, w) -> (b, w')) -> (Writer w a) -> Writer w' b { } #
Map both the return value and output.
<*> :: { } #
>>= :: { } #
execWriterT :: (Monad m) => (WriterT w m a) -> m w { } #
Run and return only the output.
mapWriterT :: ((m (a, w)) -> n (b, w')) -> (WriterT w m a) -> WriterT w' n b { } #
Map the inner computation.
tell :: (Monad m) => w -> WriterT w m () { } #
O(1). Produce output without a result value.
listen :: (Monad m) => (WriterT w m a) -> WriterT w m (a, w) { } #
O(1). Execute a computation and collect its output.
pass :: (Monad m) => (WriterT w m (a, w -> w)) -> WriterT w m a { } #
O(1). Execute a computation that can transform its output.
listens :: (Monad m) => (w -> b) -> (WriterT w m a) -> WriterT w m (a, b) { } #
O(1). Execute and apply a function to the output.
censor :: (Monad m) => (w -> w) -> (WriterT w m a) -> WriterT w m a { } #
O(1). Transform the output of a computation.
writer :: (Monad m) => (a, w) -> WriterT w m a { } #
O(1). Create a writer from a result and output pair.
instance Functor m => Functor (WriterT w m) { }
instance Monoid w => MonadTrans (WriterT w) { }
instance Monoid w, MonadIO m => MonadIO (WriterT w m) { }
instance Monoid w, Monad m => MonadWriter w (WriterT w m) { }