Advertisement
Guest User

Haskel wordfrequency ignoring case

a guest
Oct 24th, 2017
160
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import Data.List
  2. import Data.Ord
  3. import Data.Text
  4.  
  5. main = interact $ (=<<) (\x -> show (Data.List.length x) ++ " - " ++ Data.List.head x ++ "\n")
  6.                 . sortBy (flip $ comparing Data.List.length)
  7.                 . Data.List.group . Data.List.sort
  8.                 . Data.List.words . unpack . toLower . pack
Advertisement
Advertisement
Advertisement
RAW Paste Data Copied
Advertisement