Added 'Haskell/unzip.hs'

This commit is contained in:
anon 2024-07-22 19:39:19 +02:00
parent d502c853df
commit 5fddab3925

7
Haskell/unzip.hs Normal file
View File

@ -0,0 +1,7 @@
-- 4.
-- unzip' [('a', 1), ('b', 2)] = ("ab", [1, 2])
unzip'' :: ([a], [b]) -> [(a, b)] -> ([a], [b])
unzip'' l [] = l
unzip'' (a, b) ((c, d):xs) = unzip''(a ++ [c], b ++ [d]) xs
unzip' l = unzip'' ([], []) l