Proposal: Adding on

Duncan Coutts duncan.coutts at
Fri Nov 3 14:14:12 EST 2006

On Fri, 2006-11-03 at 18:05 +0100, Nils Anders Danielsson wrote:
> On Fri, 03 Nov 2006, Duncan Coutts <duncan.coutts at> wrote:
> >    groupBy ((==) `on` fst)
> Read it as "group by equality on first".
> > vs groupBy (equating fst)
> > So do you suggest that we deprecate and remove comparing?
> Yes, this seems like a good idea. (I had forgotten that comparing was
> added before 6.6 was released.) I can add a deprecation pragma to my
> patch. Any objections?

As I've said before, I think there is room for both the general and
special cases. We're not talking about polluting the namespace here,
Data.Ord and Data.Eq are pretty new and have to be imported explicitly.
It's not like adding something to Data.List which many existing programs
import without qualification.

But mainly I think it should be consistent. We should either have all
three or just `on`. Keeping comparing but not adding equating doesn't
seem to make a lot of sense. We should either agree to deprecate
comparing or add equating too.

So now that we have `on`, is there any desire for comparing and
equating. I think there is, but lets see what other people think.


More information about the Libraries mailing list