| ZVON > References > Haskell reference |
| Intro / Search / ZVON |
| | Indexes | Syntax | Prelude | Ratio | Complex | Numeric | Ix | Array | >> List << | Maybe | Char | Monad | IO | Directory | System | Time | Locale | CPUTime | Random |
| Module: | List |
|---|---|
| Function: | sortBy |
| Type: | (a -> a -> Ordering) -> [a] -> [a] |
| Description: | |
| Related: | group, groupBy, inits, intersperse, mapAccumL, mapAccumR, nub, nubBy, partition, sort, tails, transpose |
Input: sortBy compare [3,2,5,2,1]
Output: [1,2,2,3,5]
Program source: xxx a b | odd a = LT | otherwise = GT
Input: sortBy xxx [1,2,3,4,5,6,7]
Output: [1,3,5,7,6,4,2]