
23 Jan
2010
23 Jan
'10
10:11 p.m.
Hi Sergey Are you sure you always want return to write as well? 'return' for the standard' MTL writer monad produces _a_ within the monad, but does no "writing": instance (Monoid w) => Monad (Writer w) where return a = Writer (a, mempty) m >>= k = Writer $ let (a, w) = runWriter m (b, w') = runWriter (k a) in (b, w `mappend` w') Text.XHtml.Transitional has the noHtml function which would be the analogue to mempty. Best wishes Stephen