
21 Nov
2006
21 Nov
'06
8:10 a.m.
On Tue, 21 Nov 2006, Matthias Fischmann wrote:
On Tue, Nov 21, 2006 at 09:53:09AM +0100, Ketil Malde wrote:
sortBy ((. tail . fst) . compare . tail . fst)
this would actually be a nice thing to have in the standard libraries:
sortOn :: (Ord b) => (a -> b) -> [a] -> [a] sortOn f = sortBy $ (.f) . compare . f
http://www.haskell.org/pipermail/libraries/2006-November/006169.html