compareBy :: Ord b => (a -> b) -> a -> a -> Ordering compareBy f x y = f x `compare` f y
sortBy (compareBy length) ["abc", "a", "ab"] ↪ ["a","ab","abc"]
This page was created 2007-10-02.
It is tagged with:
Contact me!