
22 Feb
2010
22 Feb
'10
1:53 p.m.
On Sun, 21 Feb 2010, Leon Smith wrote:
On Sat, Feb 20, 2010 at 5:47 AM, Andrew Coppin
wrote: sortOn :: (Ord y) => (x -> y) -> [x] -> [x] sortOn foo = sortBy (compare `on` foo)
Incidentally, this function is provided as Data.List.Ordered.sortOn' in the data-ordlist package...
Or Key.sort in utility-ht which caches the keys to be sorted. Useful if the function is not just a record selector. http://hackage.haskell.org/packages/archive/utility-ht/0.0.5.1/doc/html/Data...