some-usable-scripts/haskell/columnv7.hs
2016-01-23 14:11:47 +01:00

4 lines
217 B
Haskell

import Data.List
main = interact (unlines . map unwords . transpose . map (pad ' ') . transpose . pad "" . map words . lines)
where pad v m = map (\e -> e ++ replicate ((maximum $ map length m)- length e) v) m