Maybe Monoid spilt milk

Don Stewart dons at
Thu Nov 29 13:37:26 EST 2007

> Hi folks
> I realise I should have been paying more attention last March,
> and as such have no reason to expect any sympathy, let alone
> action.
> I would, however, like to comment on the fact that the
> Data.Monoid instance for (Maybe x) prioritises monoidal
> structure from x over monoidal structure from Maybe. This
> makes it hard to use generic monoidal operations to support
> choice in the Maybe monad.
> I don't know if this breaks anybody else's code, but it
> certainly breaks mine. I guess I'll just have to stop using
> Data.Monoid and roll my own. That's not a serious hardship,
> I suppose.

The Monoid instance is not that widely used -- I think it is not too
late to change. You could propose correcting it, with some examples of
why it is more flexible

-- Don

More information about the Libraries mailing list