[Haskell-beginners] different function implementations for
different values of typevar - is it possible?
stephen.tetley at gmail.com
Sat Jan 23 17:11:50 EST 2010
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.
More information about the Beginners