Created
May 11, 2016 22:05
-
-
Save JuanFdS/45add7706f531fd650cbbc026d6ed925 to your computer and use it in GitHub Desktop.
Zip resuelto sin recursividad
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zip''::[a]->[b]->[(a,b)] | |
zip'' = foldr group (\_ -> []) | |
where | |
group x f (y:ys) = (x,y):(f ys) | |
group _ _ [] = [] | |
zip'::[a]->[b]->[(a,b)] | |
zip' l1 = snd.foldl sarasa (l1,[]) | |
where | |
sarasa ([],acum) _ = ([],acum) | |
sarasa ((x:xs),acum) y = (xs,(x,y):acum) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment