[Haskell-cafe] Associated Type Synonyms question

Ross Paterson ross at soi.city.ac.uk
Mon Feb 13 04:39:26 EST 2006

On Sun, Feb 12, 2006 at 09:32:14PM +0100, Niklas Broberg wrote:
> Irrelevant to the discussion above, but I wonder whether the Monoid
> constraint should really be there on MonadWriter. I could imagine lots
> of interesting applications of writer monads that don't output a
> monoid, an example would be a monad that iteratively computes a result
> of better and better precision and "tells" the result of each step
> until told to stop. In this case the merging would not be mplus but to
> always throw away the old argument (flip const).

You also need a value for return.  Then the monad laws will ensure
that you have another monoid.

More information about the Haskell-Cafe mailing list