Skip to content

add `reverseSort` to Data.List

Motivation

It seems reasonable to have a "fused" reverse sort function in base.

See also https://ro-che.info/articles/2016-04-02-descending-sort-haskell

Proposal

Add reverseSort function to Data.List to provide an easily discoverable way to doing a descending sort of a list.

reverseSort :: Ord a => [a] -> [a]

From my testing it seems that reverse . sort is actually fast(est) (at least for -O1), though it doesn't stabilize the sort order.

Edited by Jens Petersen
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information