Recently, I wanted a way to iterate over two sequences in LINQ the same way you do in functional languages like python. It's most commonly called zip() and it works like this:
seq = [fn(a1, b1) for a1, b1 in zip(a, b)]
This applies a function fn() to each pair of variables pulled from a and b together. There is no direct way to do this in LINQ 3.5, but I came across MoreLinq which has an implementation of zip() and many other useful functions.

Leave a comment