Proposal: Add First and Last wrappers around Maybe to Data.Monoid

David Menendez zednenem at
Mon Mar 5 00:08:43 EST 2007

Jeffrey Yasskin writes:

> I've created to
> suggest adding two Monoid instances around Maybe that, instead of
> accumulating things like most monoids, just pick the first or last
> piece of data they see.

Rather than have two wrappers, I say make the a Monoid instance for
Maybe using a left-biased choice (like the MonadPlus instance).

Then we would get right-biased choice for free with the Dual wrapper.
David Menendez <zednenem at> | "In this house, we obey the laws
<>      |        of thermodynamics!"

More information about the Libraries mailing list