Added 'Haskell/unzip.hs'
This commit is contained in:
parent
d502c853df
commit
5fddab3925
7
Haskell/unzip.hs
Normal file
7
Haskell/unzip.hs
Normal 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
|
Loading…
x
Reference in New Issue
Block a user