fork download
  1. import Data.List
  2. import Control.Arrow
  3. main :: IO ()
  4. main = print $ f "We will encourage you to develop the three great virtues of a programmer: laziness, impatience, and hubris."
  5. f :: String -> [String]
  6. f = map (uncurry (++) . (((++ "=>") . show) *** show) . (head &&& length)) . group . sort
  7.  
Success #stdin #stdout 0s 6232KB
stdin
Standard input is empty
stdout
["' '=>16","','=>2","'.'=>1","':'=>1","'W'=>1","'a'=>7","'b'=>1","'c'=>2","'d'=>2","'e'=>14","'f'=>1","'g'=>3","'h'=>3","'i'=>6","'l'=>4","'m'=>3","'n'=>4","'o'=>6","'p'=>3","'r'=>8","'s'=>4","'t'=>6","'u'=>4","'v'=>2","'w'=>1","'y'=>1","'z'=>1"]