Proposal: add `on` to the Prelude

Helmut Schmidt at
Wed Sep 11 06:17:21 UTC 2019

Am Mi., 11. Sept. 2019 um 02:18 Uhr schrieb Edward Kmett <ekmett at>:

> There are combinators I'm somewhat inclined to push into Prelude after an
> appropriate referendum, e.g. traverse_ or sequence_ which do a lot of work
> and are quite conspicuous in their absence, when a
> worse-for-many-applications but comparable tool is closer to hand, but the
> slight pain of explicitly importing 'on' seems pretty reasonable given the
> combination of its somewhat confusing at first idiomatic usage, and the
> somewhat broadly spread existing name conflicts.

This slight pain of writing "import Data.Function (on)" as you call is why
I and probably most other people don't bother using "on". But why is such a
trivial combinator that's cheaper to define locally than to import even
defined in the base library if the pain of using it outweighs its
usefulness and there's just a handful of people at best using it?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list