Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 11 lines (8 sloc) 402 Bytes
#!/usr/bin/env runhaskell
import System.Environment
import Data.List
main = interact $ \text -> let rows = map words (lines text)
cols = transpose rows
rows' = transpose $ map (\col -> map (padTo (maximum (map length col))) col) cols
in unlines $ map unwords rows'
padTo n s = s ++ replicate (n - length s) ' '