From 499fa18707f6fc0dfa7a7784da33ba10d7592b37 Mon Sep 17 00:00:00 2001 From: Karchnu Date: Sat, 23 Jan 2016 01:05:34 +0100 Subject: [PATCH] replicate + interact => 3 lignes --- haskell/columnv7.hs | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 haskell/columnv7.hs diff --git a/haskell/columnv7.hs b/haskell/columnv7.hs new file mode 100644 index 0000000..9d50fad --- /dev/null +++ b/haskell/columnv7.hs @@ -0,0 +1,3 @@ +import Data.List +main = do interact $ (unlines . map unwords . transpose . map (completeMatrix ' ') . transpose . completeMatrix "" . map words . lines) + where completeMatrix v m = map (\e -> e ++ replicate ((maximum $ map length m)- length e) v) m