
On Mon, 14 Mar 2005, Remi Turk wrote:
On Mon, Mar 14, 2005 at 11:39:55AM -0000, Simon Marlow wrote:
Just attempting to empty my inbox... we never resolved this one. Perhaps there should be Data.Ord (and Data.Eq for that matter), and then we'd have an obvious place to put comparing?
Cheers, Simon
Some people (no idea how many, though at least 1 ;) seem to prefer something like this:
cmp `on` conv = \x y -> conv x `cmp` conv y
sortBy (compare `on` fst) groupBy ((==) `on` isSpace)
though some people (at least Henning Thielemann) prefer to call it compose2.
http://www.haskell.org/hawiki/ThingsToAvoid http://www.haskell.org/hawiki/ThingsToAvoid_2fDiscussion contains some discussion about it.
I won't defend 'compose2' if you dislike it, :-) but I wanted something more specific than 'on' and I didn't see the need for an infix notation.