Zip overload which returns sequence of tuples
It would be very convenient, esp in the context of the functional programming paradigm (which thanks to MoreLinq is much more attainable in C#!), to have kind of a "default" Zip() that returns tuples of the two zipped collections. Right now we always have to provide function like (x1, x2) => (x1, x2), which, if we accept tuples as first-class citizens, seems repetitive and adds clutter to the code.
This is a good idea and something I've been wanting to do for some time. Is it something you would like to help with?
Meanwhile, you don't have spell out the whole lambda like (x1, x2) => (x1, x2). You can just get away with supplying the ValueTuple.Create method group, as in xs.Zip(ys, ValueTuple.Create).
Sorry for the delay. Yes I'd be glad to help with that; will create a pull request when I get the chance.
This comment is just a note that while the same was done for Enumerable.Zip in the CoreFX repo, it was later reverted due to strong differences in opinions about the naming convention that applies to tuple element names. Until such differences are reconciled, it seems that tuples will not be exposed in any CoreFX API any time soon.
Good thing we never debated that too hard, 😅went with Pascal casing and haven't looked back.
Addressed in zip refactoring #639 and in #598
Fixed in #639
Correction: this is being addressed in PR #598. It is not fixed unless a PR is merged into the master branch and neither PR #598 nor PR #639 have been merged. I felt compelled to drop this note so anyone reading “fixed” doesn't build up the wrong expectation. That said, I hope to get to the bottom of this thanks to a lot of your help in the area.
Fixed in #639
Correction: this is being addressed in PR #598. It is not fixed unless a PR is merged into the master branch and neither PR #598 nor PR #639 have been merged. I felt compelled to drop this note so anyone reading “fixed” doesn't build up the wrong expectation. That said, I hope to get to the bottom of this thanks to a lot of your help in the area.
Sorry about that, I will try to be careful about what I wrote.