Proposal: add 'equating' function to Data.List

Frerich Raabe raabe at
Sun Jul 20 10:51:41 UTC 2014

On 2014-07-18 21:26, Frerich Raabe wrote:
> In a similiar vein as with 'comparing', I think it would be nice if there 
> was a function which encapsulates this use case, like
>   equating :: Eq b => (a -> b) -> a -> a -> Bool
>   equating = on (==)
> such that one can write
>   groupBy (equating snd)

I don't know whether this is relevant to the decision making process, but it 
appears there's some precedence already in the 'basic-prelude' package by Dan 
Burton and Michael Snoyman: the 'CorePrelude' module exposes an 'equating' 

- Frerich

More information about the Libraries mailing list