
14 Mar
2005
14 Mar
'05
6:56 a.m.
"Simon Marlow"
comparing :: (Ord a) => (b -> a) -> b -> b -> Ordering comparing p x y = compare (p x) (p y)
sortBy (comparing fst)
is just too cute not to have. Any objections?
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?
Seems OK to me. I couldn't find an existing definition of the Eq or Ord class anywhere in the base package - is it currently only in the haskell98 Prelude? Regards, Malcolm