Multiplication tables: Difference between revisions

→‎{{header|Haskell}}: (Rearranged table function)
(→‎{{header|Haskell}}: (Rearranged table function))
Line 2,339:
table :: String -> [[String]] -> [String]
table delim rows =
let justifyRight n c n s = drop (length s) (replicate n c <> s)
in intercalate delim <$>
transpose
((\colfmap ->=<< justifyRight (' ' . maximum (length. <$>fmap collength)) ' ' <$> coltranspose rows) <$>
transpose rows)
 
main :: IO ()
9,659

edits