Last active
July 6, 2017 09:34
-
-
Save dwickstrom/0a419fa7240595685d7394315d7af350 to your computer and use it in GitHub Desktop.
Zip impl
This file contains hidden or 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)] | |
const zip = ([x, ...xs]) => ([y, ...ys]) => | |
[[x, y], ...zip (xs) (ys)] | |
const zip = xs => ys => | |
xs.reduce((acc, curr, idx) => | |
[[curr, ys[idx]], ...acc], []) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment