view test.hs @ 3085:6ec6d750fbf0

<nooodl> echo s/\\\\w\\\\w\\\\w\\\\w\\\\+/\\\\0chaf/g >> bin/chaf
author HackBot
date Tue, 11 Jun 2013 17:38:06 +0000
parents 831ffc1f8007
children
line wrap: on
line source

import Data.Maybe (catMaybes)
import Data.List (group, sort, stripPrefix)
main = mapM_ putStrLn . map (\s -> head s ++ " occurs->" ++ show (length s)) . group . sort . catMaybes . map (stripPrefix "username:" . (!!2) . words) . lines =<< getContents