Maybe Monoid spilt milk

Conor McBride ctm at Cs.Nott.AC.UK
Thu Nov 29 13:29:05 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

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.

I have only myself to blame, and I'm not proposing that the
Maybe behaviour is changed. I suppose people are busy enjoying
the instance as it now stands, and that it would be damaging
to change.

What a pity


This message has been checked for viruses but the contents of an attachment
may still contain software viruses, which could damage your computer system:
you are advised to perform your own checks. Email communications with the
University of Nottingham may be monitored as permitted by UK legislation.

More information about the Libraries mailing list