
8 Dec
2012
8 Dec
'12
11:49 p.m.
Excerpts from Holger Siegel's message of Sat Dec 08 15:27:38 -0800 2012:
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. Therefore, I'm not yet convinced that every instance of (MonadWriter w m) gives rise to a monoid instance of w.
Definitely not. I need a way of running the monad, some way or another, otherwise, it's like having the IO monad without a 'main' function :) But you don't need very much to get there... Edward