diff --git a/exercises/md-table/MdTable.hs b/exercises/md-table/MdTable.hs index de0e0a8..cf2c893 100644 --- a/exercises/md-table/MdTable.hs +++ b/exercises/md-table/MdTable.hs @@ -24,13 +24,11 @@ equalizeColumnSize :: [[String]] -> [[String]] equalizeColumnSize [] = [] equalizeColumnSize (x:xs) = [pad y | y <- x] : (equalizeColumnSize xs) where pad z = padWith ' ' (getMaxColumnLength (x:xs)) z - toLine :: [String] -> String toLine [] = "|" toLine (x:xs) = "| " ++ x ++ " " ++ toLine xs - padWith :: (Eq a) => a -> Int -> [a] -> [a] padWith _ 0 x | x == [] = [] | otherwise = x diff --git a/exercises/permutations/perm.hs b/exercises/permutations/perm.hs index 91c701e..03a5444 100644 --- a/exercises/permutations/perm.hs +++ b/exercises/permutations/perm.hs @@ -4,4 +4,4 @@ import Data.List hiding (permutations) permutations :: [Int] -> [[Int]] permutations [] = [[]] -permutations (x:xs) = [ y:ys | y <- (x:xs), ys <- permutations xs] +permutations xs = [ y:ys | y <- xs, ys <- permutations (delete y xs)]