Created
August 4, 2020 12:27
-
-
Save crclark96/65ebf3e533351ba4929f65b4648793c9 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
import Data.List | |
import Data.Ord | |
charNumSort :: [String] -> [String] | |
charNumSort = sortBy ((comparing $ length . nub) `mappend` (comparing $ Down . length)) |
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
*Main> charNumSort ["Bananas","do","not","grow","in","Mississippi"] | |
["do","in","not","Mississippi","Bananas","grow"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment