[Haskell-cafe] Monoid wants a (++) equivalent

Geoffrey Marchant geoffrey.marchant at gmail.com
Wed Jul 1 22:24:59 EDT 2009

Obviously `mappend` is good enough as it is.

Choosing (+>) or (<>) are just for prettifying code.

Generalizing (++) not only makes the code prettier, but also brings Monoid
into the Prelude.

You can either Do It Right(tm), or be conservative and try to maintain
backwards compatibility as much as possible.

I suspect most people in the community understand the trade-offs here, and
would agree on the proper solution. If that means rewriting the standard,
then so be it.

On Wed, Jul 1, 2009 at 12:26 PM, Ross Paterson <ross at soi.city.ac.uk> wrote:

> On Wed, Jul 01, 2009 at 10:55:39AM -0700, Bryan O'Sullivan wrote:
> > Okay, here's a tentative plan that will help to figure out the answer.
> I'll
> > build a fiddled base package that rewires the Monoid class to have (++)
> be the
> > binary operator, and mappend as a synonym for it. I'll import the Monoid
> (++)
> > into the Prelude. I'll see how much breaks. If that much builds smoothly,
> I'll
> > see how much of the rest of Hackage builds, both with and without this
> custom
> > base package. I'll follow up here with the results, along with a
> suggestion of
> > how acceptable I think the observed level of breakage is.
> Generalizing (++) will break some Haskell 98 code, e.g.
>  append = (++)
> I think that's a show-stopper.
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20090701/0126d3c4/attachment.html

More information about the Haskell-Cafe mailing list