Proposal: add 'equating' function to Data.List

Edward Kmett ekmett at gmail.com
Sat Jul 19 12:54:18 UTC 2014


I didn't mean to preëmpt the whole discussion thread -- I'd rather let that play out, but I just wanted to express where my personal opinion lies on this matter.

Data.Eq does sound like the right place for it, if we do go to put it in.

-Edward

> On Jul 19, 2014, at 8:50 AM, Alexander Berntsen <alexander at plaimi.net> wrote:
> 
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA256
> 
>> On 19/07/14 14:44, Edward Kmett wrote:
>> I'm ever so slightly +1 on this proposal.
>> 
>> Why? Because it gets reinvented every 4 months, and by just adding
>> it we can stop having this discussion.
>> 
>> I hereby proposed there exists a "co-Fairbairn threshold", the
>> point at which the traffic caused by fighting against adding a
>> commonly reinvented simple composition outweighs the pedagogical
>> gain of pushing people to understand the simpler parts.
> OK, you have me convinced. You should put these thresholds of yours on
> the GHC Wiki or something. ;-)
> 
>> That said, I'd prefer it live alongside comparing, and not get
>> pushed redundantly around to other modules.
> I suggest:
> equating :: Eq a => (b -> a) -> b -> b -> Bool
> equating p x y = (p x) == (p y)
> 
> in Data.Eq, exposing it with
> 
> module Data.Eq (
>   Eq(..),
> ) where
> 
> If this sounds good I can write a patch for it, test it & upload it to
> phab to have it built & reviewed by austin and you. :-)
> - -- 
> Alexander
> alexander at plaimi.net
> https://secure.plaimi.net/~alexander
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v2
> Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
> 
> iF4EAREIAAYFAlPKaZ8ACgkQRtClrXBQc7WqgwEAgmlzkK+/JdsGDZ2OabyNPE8W
> y2zffqFTvus/GYO1S00BAKC3ncHM5R01sgrZfE8BhstzNNQ3JnTF5CoReBUedc4R
> =u6pc
> -----END PGP SIGNATURE-----
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries


More information about the Libraries mailing list