some-usable-scripts/haskell/columnv7.hs

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