Created
May 2, 2015 08:37
-
-
Save jbrestan/fbce490f33f820fcad55 to your computer and use it in GitHub Desktop.
(Ineffective) zip using fold
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
let zip xs ys = | |
let step acc x = | |
match acc with | |
| (rs, y::ys) -> ((x,y)::rs, ys) | |
| _ -> acc | |
Seq.fold step ([], ys) xs | |
|> fst | |
|> List.rev |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment