Created
September 10, 2014 20:37
-
-
Save PatrickMcDonald/1d7be5d68aefcc45fc57 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[<CompiledName("SortByDescending")>] | |
let sortByDescending f xs = | |
match xs with | |
| [] | [_] -> xs | |
| _ -> | |
let compareByDescending x y = compare (f y) (f x) | |
sortWith compareByDescending xs | |
[<CompiledName("SortDescending")>] | |
let sortDescending xs = | |
match xs with | |
| [] | [_] -> xs | |
| _ -> | |
let compareDescending x y = compare y x | |
sortWith compareDescending xs |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment