On Fri, Jun 24, 2011 at 11:13:46PM -0700, wren ng thornton wrote:
> On 6/25/11 1:34 AM, Evan Laforge wrote:
> > So there's a range of possible Monoid instances for each type,
>
> More for some types than for others. For Maybe there are three:
>
> * always take the first/left value;
> * always take the last/right value;
> * or, use a semigroup operation defined on the values.
Actually, there are (at least) four: there's also the one where
mappend = liftA2 mappend, i.e. introduce potential failure into a
monoid operation defined on the values. I wrote about it here:
http://byorgey.wordpress.com/2011/04/18/monoids-for-maybe/
-Brent
_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe