Proposal: add 'equating' function to Data.List

Alexander Berntsen alexander at plaimi.net
Sat Jul 19 12:50:39 UTC 2014


-----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-----


More information about the Libraries mailing list