import System main = do (indent:_) <- getArgs interact (prettierwc (read indent :: Int)) wc s = [length (lines s), length (words s), length s] rjustify width s = take (width - length s) (repeat ' ') ++ s prettierwc indent s = unlines $ zipWith (++) ["Lines: ","Words: ","Chars: "] $ map (rjustify indent) $ map show $ wc s