Skip to content

Instantly share code, notes, and snippets.

@lnicola
Created June 26, 2014 12:11
Show Gist options
  • Save lnicola/a896281a7fcac1847570 to your computer and use it in GitHub Desktop.
Save lnicola/a896281a7fcac1847570 to your computer and use it in GitHub Desktop.
module Main where
import Control.Monad
import Data.Char
import Data.List
import Data.Ord
process = reverse . (sortBy $ comparing snd) . (map $ \x -> (head x, length x)) . group . sort . words . map toLower . filter (flip notElem "().,\"")
main = getContents >>= print . process
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment