
"Samuel Bronson"
(*) `on` f = \x y -> f x * f y
groupBy ((==) `on` fst) sortBy (compare `on` snd) maximumBy (customCompare `on` f)
Oh, oops. I meant to send this to the list the *first* time... so, um, where is the patch for this?
The question is where in the module hierarchy should such a function live? It does not really belong with Data.List, or indeed any particular data structure module. I would like to propose a new module for functions like this, which are in some sense "purely" functional, that is, they do not involve any data structure at all, just functions. Other examples would be const id flip (.) ($) ($!) Any suggestions for a good name for such a module? Data.Function does not sound right to my ears. Regards, Malcolm