Given a Writer monad action, I want to modify it by mapping a function over the written data inside the monad action.
Something like:
retell :: (w -> w') -> Writer w a -> Writer w' a Does such a function already exists in the libraries? If not, how can one be defined?
passmethod in the MonadWriter class? If not I'd make my own subclass of Writer -Rewriterthat provides aretelloperation.wof the Writer monad you can't do this withpass. I would go with aRewritersubclass that extendsWriterwithretell.