
8 Dec
2012
8 Dec
'12
11:51 p.m.
Am 09.12.2012 um 00:27 schrieb Holger Siegel:
For deriving a monoid instance of w from monad (Writer w), you will need function execWriter:: Writer w a -> w, but in case of a general instance of (MonadWriter w m) you would have to use function listen :: m a -> m (a, w) that will only provide you a value of type (m w), but not of type w.
sorry, I meant function execWriterT :: Monad m => WriterT w m a -> m w.
Therefore, I'm not yet convinced that every instance of (MonadWriter w m) gives rise to a monoid instance of w.