Proposal: add `on` to the Prelude

George Wilson george at wils.online
Sun Sep 15 22:27:40 UTC 2019


-1
I find `on` rather handy, but I would prefer that Prelude not claim so
many identifiers, especially short ones like this.

On Sun, 15 Sep 2019 at 12:18, David Feuer <david.feuer at gmail.com> wrote:
>
> I consider equating (and comparing) a bit of an anti-pattern. They're extra names to express what `on` does more generally, and barely save any characters over it
>
> On Sat, Sep 14, 2019, 2:51 PM Erik Hesselink <hesselink at gmail.com> wrote:
>>
>> On Fri, 13 Sep 2019 at 13:54, Henning Thielemann <lemming at henning-thielemann.de> wrote:
>>>
>>>
>>> On Tue, 10 Sep 2019, David Feuer wrote:
>>>
>>> > Every time I reach for Data.Function.on, I feel like a total dolt for having to import a module to get a function
>>> > whose implementation is barely longer than the import. And it's a really good function too! Can we please add it
>>> > to the Prelude?
>>> >   on :: (b -> b -> c) -> (a -> b) -> a -> a -> c
>>> >   (.*.) `on` f = \x y -> f x .*. f y
>>>
>>> Most of the time I would use this I can use the more specific 'equating'
>>> and 'comparing'.
>>
>>
>> Does 'equating' exist in base now? I've always missed having that function in the past, and defined it myself many times.
>>
>> Erik
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries


More information about the Libraries mailing list