diff --git a/MoreLinq/EquiZip.cs b/MoreLinq/EquiZip.cs
deleted file mode 100644
index edede6ef1..000000000
--- a/MoreLinq/EquiZip.cs
+++ /dev/null
@@ -1,213 +0,0 @@
-#region License and Terms
-// MoreLINQ - Extensions to LINQ to Objects
-// Copyright (c) 2008 Jonathan Skeet. All rights reserved.
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-//
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-#endregion
-
-namespace MoreLinq
-{
- using System;
- using System.Collections.Generic;
- using System.Diagnostics;
- using System.Linq;
-
- static partial class MoreEnumerable
- {
- ///
- /// Returns a projection of tuples, where each tuple contains the N-th
- /// element from each of the argument sequences. An exception is thrown
- /// if the input sequences are of different lengths.
- ///
- /// Type of elements in first sequence.
- /// Type of elements in second sequence.
- /// Type of elements in result sequence.
- /// The first sequence.
- /// The second sequence.
- ///
- /// Function to apply to each pair of elements.
- ///
- /// A sequence that contains elements of the two input sequences,
- /// combined by .
- ///
- ///
- /// The input sequences are of different lengths.
- ///
- ///
- /// n + l);
- /// ]]>
- /// The zipped variable, when iterated over, will yield "1A",
- /// "2B", "3C", "4D" in turn.
- ///
- ///
- /// This operator uses deferred execution and streams its results.
- ///
-
- public static IEnumerable EquiZip(
- this IEnumerable first,
- IEnumerable second,
- Func resultSelector)
- {
- if (first == null) throw new ArgumentNullException(nameof(first));
- if (second == null) throw new ArgumentNullException(nameof(second));
- if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector));
-
- return EquiZipImpl(first, second, null, null, (a, b, c, d) => resultSelector(a, b));
- }
-
- ///
- /// Returns a projection of tuples, where each tuple contains the N-th
- /// element from each of the argument sequences. An exception is thrown
- /// if the input sequences are of different lengths.
- ///
- /// Type of elements in first sequence.
- /// Type of elements in second sequence.
- /// Type of elements in third sequence.
- /// Type of elements in result sequence.
- /// The first sequence.
- /// The second sequence.
- /// The third sequence.
- ///
- /// Function to apply to each triplet of elements.
- ///
- /// A sequence that contains elements of the three input sequences,
- /// combined by .
- ///
- ///
- /// The input sequences are of different lengths.
- ///
- ///
- /// n + l + c);
- /// ]]>
- /// The zipped variable, when iterated over, will yield "1Aa",
- /// "2Bb", "3Cc", "4Dd" in turn.
- ///
- ///
- /// This operator uses deferred execution and streams its results.
- ///
-
- public static IEnumerable EquiZip(
- this IEnumerable first,
- IEnumerable second, IEnumerable third,
- Func resultSelector)
- {
- if (first == null) throw new ArgumentNullException(nameof(first));
- if (second == null) throw new ArgumentNullException(nameof(second));
- if (third == null) throw new ArgumentNullException(nameof(third));
- if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector));
-
- return EquiZipImpl(first, second, third, null, (a, b, c, _) => resultSelector(a, b, c));
- }
-
- ///
- /// Returns a projection of tuples, where each tuple contains the N-th
- /// element from each of the argument sequences. An exception is thrown
- /// if the input sequences are of different lengths.
- ///
- /// Type of elements in first sequence
- /// Type of elements in second sequence
- /// Type of elements in third sequence
- /// Type of elements in fourth sequence
- /// Type of elements in result sequence
- /// The first sequence.
- /// The second sequence.
- /// The third sequence.
- /// The fourth sequence.
- ///
- /// Function to apply to each quadruplet of elements.
- ///
- /// A sequence that contains elements of the four input sequences,
- /// combined by .
- ///
- ///
- /// The input sequences are of different lengths.
- ///
- ///
- /// n + l + c + f);
- /// ]]>
- /// The zipped variable, when iterated over, will yield "1AaTrue",
- /// "2BbFalse", "3CcTrue", "4DdFalse" in turn.
- ///
- ///
- /// This operator uses deferred execution and streams its results.
- ///
-
- public static IEnumerable EquiZip(
- this IEnumerable first,
- IEnumerable second, IEnumerable third, IEnumerable fourth,
- Func resultSelector)
- {
- if (first == null) throw new ArgumentNullException(nameof(first));
- if (second == null) throw new ArgumentNullException(nameof(second));
- if (third == null) throw new ArgumentNullException(nameof(third));
- if (fourth == null) throw new ArgumentNullException(nameof(fourth));
- if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector));
-
- return EquiZipImpl(first, second, third, fourth, resultSelector);
- }
-
- static IEnumerable EquiZipImpl(
- IEnumerable s1,
- IEnumerable s2,
- IEnumerable s3,
- IEnumerable s4,
- Func resultSelector)
- {
- Debug.Assert(s1 != null);
- Debug.Assert(s2 != null);
-
- const int zero = 0, one = 1;
-
- var limit = 1 + (s3 != null ? one : zero)
- + (s4 != null ? one : zero);
-
- return ZipImpl(s1, s2, s3, s4, resultSelector, limit, enumerators =>
- {
- var i = enumerators.Index().First(x => x.Value == null).Key;
- return new InvalidOperationException(OrdinalNumbers[i] + " sequence too short.");
- });
- }
-
- static readonly string[] OrdinalNumbers =
- {
- "First",
- "Second",
- "Third",
- "Fourth",
- // "Fifth",
- // "Sixth",
- // "Seventh",
- // "Eighth",
- // "Ninth",
- // "Tenth",
- // "Eleventh",
- // "Twelfth",
- // "Thirteenth",
- // "Fourteenth",
- // "Fifteenth",
- // "Sixteenth",
- };
- }
-}
diff --git a/MoreLinq/EquiZip.g.cs b/MoreLinq/EquiZip.g.cs
new file mode 100644
index 000000000..97f37b883
--- /dev/null
+++ b/MoreLinq/EquiZip.g.cs
@@ -0,0 +1,824 @@
+#region License and Terms
+// MoreLINQ - Extensions to LINQ to Objects
+// Copyright (c) 2019 Pierre Lando. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#endregion
+
+namespace MoreLinq
+{
+ using System;
+ using System.Collections.Generic;
+
+ static partial class MoreEnumerable
+ {
+ ///
+ /// Returns a projection of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in result sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ ///
+ /// Function to apply to each tuple of elements.
+ ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ Func resultSelector)
+ {
+ if (first == null) throw new ArgumentNullException(nameof(first));
+ if (second == null) throw new ArgumentNullException(nameof(second));
+ if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector));
+
+ return _(); IEnumerable _()
+ {
+ using var e1 = first.GetEnumerator();
+ using var e2 = second.GetEnumerator();
+
+ for (;;)
+ {
+ if (e1.MoveNext())
+ {
+ if (e2.MoveNext())
+ yield return resultSelector(e1.Current, e2.Current);
+ else
+ break;
+ }
+ else
+ {
+ if (e2.MoveNext())
+ break;
+ else
+ yield break;
+ }
+ }
+
+ throw new InvalidOperationException($"Sequences differ in length.");
+ }
+ }
+
+ ///
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable<(T1, T2)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second)
+ {
+ return EquiZip(
+ first,
+ second,
+ ValueTuple.Create);
+ }
+
+ ///
+ /// Returns a projection of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in result sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ ///
+ /// Function to apply to each tuple of elements.
+ ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ Func resultSelector)
+ {
+ if (first == null) throw new ArgumentNullException(nameof(first));
+ if (second == null) throw new ArgumentNullException(nameof(second));
+ if (third == null) throw new ArgumentNullException(nameof(third));
+ if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector));
+
+ return _(); IEnumerable _()
+ {
+ using var e1 = first.GetEnumerator();
+ using var e2 = second.GetEnumerator();
+ using var e3 = third.GetEnumerator();
+
+ for (;;)
+ {
+ if (e1.MoveNext())
+ {
+ if (e2.MoveNext() && e3.MoveNext())
+ yield return resultSelector(e1.Current, e2.Current, e3.Current);
+ else
+ break;
+ }
+ else
+ {
+ if (e2.MoveNext() || e3.MoveNext())
+ break;
+ else
+ yield break;
+ }
+ }
+
+ throw new InvalidOperationException($"Sequences differ in length.");
+ }
+ }
+
+ ///
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable<(T1, T2, T3)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third)
+ {
+ return EquiZip(
+ first,
+ second,
+ third,
+ ValueTuple.Create);
+ }
+
+ ///
+ /// Returns a projection of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in result sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ ///
+ /// Function to apply to each tuple of elements.
+ ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ Func resultSelector)
+ {
+ if (first == null) throw new ArgumentNullException(nameof(first));
+ if (second == null) throw new ArgumentNullException(nameof(second));
+ if (third == null) throw new ArgumentNullException(nameof(third));
+ if (fourth == null) throw new ArgumentNullException(nameof(fourth));
+ if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector));
+
+ return _(); IEnumerable _()
+ {
+ using var e1 = first.GetEnumerator();
+ using var e2 = second.GetEnumerator();
+ using var e3 = third.GetEnumerator();
+ using var e4 = fourth.GetEnumerator();
+
+ for (;;)
+ {
+ if (e1.MoveNext())
+ {
+ if (e2.MoveNext() && e3.MoveNext() && e4.MoveNext())
+ yield return resultSelector(e1.Current, e2.Current, e3.Current, e4.Current);
+ else
+ break;
+ }
+ else
+ {
+ if (e2.MoveNext() || e3.MoveNext() || e4.MoveNext())
+ break;
+ else
+ yield break;
+ }
+ }
+
+ throw new InvalidOperationException($"Sequences differ in length.");
+ }
+ }
+
+ ///
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable<(T1, T2, T3, T4)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth)
+ {
+ return EquiZip(
+ first,
+ second,
+ third,
+ fourth,
+ ValueTuple.Create);
+ }
+
+ ///
+ /// Returns a projection of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// Type of elements in result sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ ///
+ /// Function to apply to each tuple of elements.
+ ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth,
+ Func resultSelector)
+ {
+ if (first == null) throw new ArgumentNullException(nameof(first));
+ if (second == null) throw new ArgumentNullException(nameof(second));
+ if (third == null) throw new ArgumentNullException(nameof(third));
+ if (fourth == null) throw new ArgumentNullException(nameof(fourth));
+ if (fifth == null) throw new ArgumentNullException(nameof(fifth));
+ if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector));
+
+ return _(); IEnumerable _()
+ {
+ using var e1 = first.GetEnumerator();
+ using var e2 = second.GetEnumerator();
+ using var e3 = third.GetEnumerator();
+ using var e4 = fourth.GetEnumerator();
+ using var e5 = fifth.GetEnumerator();
+
+ for (;;)
+ {
+ if (e1.MoveNext())
+ {
+ if (e2.MoveNext() && e3.MoveNext() && e4.MoveNext() && e5.MoveNext())
+ yield return resultSelector(e1.Current, e2.Current, e3.Current, e4.Current, e5.Current);
+ else
+ break;
+ }
+ else
+ {
+ if (e2.MoveNext() || e3.MoveNext() || e4.MoveNext() || e5.MoveNext())
+ break;
+ else
+ yield break;
+ }
+ }
+
+ throw new InvalidOperationException($"Sequences differ in length.");
+ }
+ }
+
+ ///
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable<(T1, T2, T3, T4, T5)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth)
+ {
+ return EquiZip(
+ first,
+ second,
+ third,
+ fourth,
+ fifth,
+ ValueTuple.Create);
+ }
+
+ ///
+ /// Returns a projection of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// Type of elements in sixth input sequence.
+ /// Type of elements in result sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ /// The sixth source sequence.
+ ///
+ /// Function to apply to each tuple of elements.
+ ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth,
+ IEnumerable sixth,
+ Func resultSelector)
+ {
+ if (first == null) throw new ArgumentNullException(nameof(first));
+ if (second == null) throw new ArgumentNullException(nameof(second));
+ if (third == null) throw new ArgumentNullException(nameof(third));
+ if (fourth == null) throw new ArgumentNullException(nameof(fourth));
+ if (fifth == null) throw new ArgumentNullException(nameof(fifth));
+ if (sixth == null) throw new ArgumentNullException(nameof(sixth));
+ if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector));
+
+ return _(); IEnumerable _()
+ {
+ using var e1 = first.GetEnumerator();
+ using var e2 = second.GetEnumerator();
+ using var e3 = third.GetEnumerator();
+ using var e4 = fourth.GetEnumerator();
+ using var e5 = fifth.GetEnumerator();
+ using var e6 = sixth.GetEnumerator();
+
+ for (;;)
+ {
+ if (e1.MoveNext())
+ {
+ if (e2.MoveNext() && e3.MoveNext() && e4.MoveNext() && e5.MoveNext() && e6.MoveNext())
+ yield return resultSelector(e1.Current, e2.Current, e3.Current, e4.Current, e5.Current, e6.Current);
+ else
+ break;
+ }
+ else
+ {
+ if (e2.MoveNext() || e3.MoveNext() || e4.MoveNext() || e5.MoveNext() || e6.MoveNext())
+ break;
+ else
+ yield break;
+ }
+ }
+
+ throw new InvalidOperationException($"Sequences differ in length.");
+ }
+ }
+
+ ///
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// Type of elements in sixth input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ /// The sixth source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable<(T1, T2, T3, T4, T5, T6)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth,
+ IEnumerable sixth)
+ {
+ return EquiZip(
+ first,
+ second,
+ third,
+ fourth,
+ fifth,
+ sixth,
+ ValueTuple.Create);
+ }
+
+ ///
+ /// Returns a projection of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// Type of elements in sixth input sequence.
+ /// Type of elements in seventh input sequence.
+ /// Type of elements in result sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ /// The sixth source sequence.
+ /// The seventh source sequence.
+ ///
+ /// Function to apply to each tuple of elements.
+ ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth,
+ IEnumerable sixth,
+ IEnumerable seventh,
+ Func resultSelector)
+ {
+ if (first == null) throw new ArgumentNullException(nameof(first));
+ if (second == null) throw new ArgumentNullException(nameof(second));
+ if (third == null) throw new ArgumentNullException(nameof(third));
+ if (fourth == null) throw new ArgumentNullException(nameof(fourth));
+ if (fifth == null) throw new ArgumentNullException(nameof(fifth));
+ if (sixth == null) throw new ArgumentNullException(nameof(sixth));
+ if (seventh == null) throw new ArgumentNullException(nameof(seventh));
+ if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector));
+
+ return _(); IEnumerable _()
+ {
+ using var e1 = first.GetEnumerator();
+ using var e2 = second.GetEnumerator();
+ using var e3 = third.GetEnumerator();
+ using var e4 = fourth.GetEnumerator();
+ using var e5 = fifth.GetEnumerator();
+ using var e6 = sixth.GetEnumerator();
+ using var e7 = seventh.GetEnumerator();
+
+ for (;;)
+ {
+ if (e1.MoveNext())
+ {
+ if (e2.MoveNext() && e3.MoveNext() && e4.MoveNext() && e5.MoveNext() && e6.MoveNext() && e7.MoveNext())
+ yield return resultSelector(e1.Current, e2.Current, e3.Current, e4.Current, e5.Current, e6.Current, e7.Current);
+ else
+ break;
+ }
+ else
+ {
+ if (e2.MoveNext() || e3.MoveNext() || e4.MoveNext() || e5.MoveNext() || e6.MoveNext() || e7.MoveNext())
+ break;
+ else
+ yield break;
+ }
+ }
+
+ throw new InvalidOperationException($"Sequences differ in length.");
+ }
+ }
+
+ ///
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// Type of elements in sixth input sequence.
+ /// Type of elements in seventh input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ /// The sixth source sequence.
+ /// The seventh source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable<(T1, T2, T3, T4, T5, T6, T7)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth,
+ IEnumerable sixth,
+ IEnumerable seventh)
+ {
+ return EquiZip(
+ first,
+ second,
+ third,
+ fourth,
+ fifth,
+ sixth,
+ seventh,
+ ValueTuple.Create);
+ }
+
+ ///
+ /// Returns a projection of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// Type of elements in sixth input sequence.
+ /// Type of elements in seventh input sequence.
+ /// Type of elements in eighth input sequence.
+ /// Type of elements in result sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ /// The sixth source sequence.
+ /// The seventh source sequence.
+ /// The eighth source sequence.
+ ///
+ /// Function to apply to each tuple of elements.
+ ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth,
+ IEnumerable sixth,
+ IEnumerable seventh,
+ IEnumerable eighth,
+ Func resultSelector)
+ {
+ if (first == null) throw new ArgumentNullException(nameof(first));
+ if (second == null) throw new ArgumentNullException(nameof(second));
+ if (third == null) throw new ArgumentNullException(nameof(third));
+ if (fourth == null) throw new ArgumentNullException(nameof(fourth));
+ if (fifth == null) throw new ArgumentNullException(nameof(fifth));
+ if (sixth == null) throw new ArgumentNullException(nameof(sixth));
+ if (seventh == null) throw new ArgumentNullException(nameof(seventh));
+ if (eighth == null) throw new ArgumentNullException(nameof(eighth));
+ if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector));
+
+ return _(); IEnumerable _()
+ {
+ using var e1 = first.GetEnumerator();
+ using var e2 = second.GetEnumerator();
+ using var e3 = third.GetEnumerator();
+ using var e4 = fourth.GetEnumerator();
+ using var e5 = fifth.GetEnumerator();
+ using var e6 = sixth.GetEnumerator();
+ using var e7 = seventh.GetEnumerator();
+ using var e8 = eighth.GetEnumerator();
+
+ for (;;)
+ {
+ if (e1.MoveNext())
+ {
+ if (e2.MoveNext() && e3.MoveNext() && e4.MoveNext() && e5.MoveNext() && e6.MoveNext() && e7.MoveNext() && e8.MoveNext())
+ yield return resultSelector(e1.Current, e2.Current, e3.Current, e4.Current, e5.Current, e6.Current, e7.Current, e8.Current);
+ else
+ break;
+ }
+ else
+ {
+ if (e2.MoveNext() || e3.MoveNext() || e4.MoveNext() || e5.MoveNext() || e6.MoveNext() || e7.MoveNext() || e8.MoveNext())
+ break;
+ else
+ yield break;
+ }
+ }
+
+ throw new InvalidOperationException($"Sequences differ in length.");
+ }
+ }
+
+ ///
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// Type of elements in sixth input sequence.
+ /// Type of elements in seventh input sequence.
+ /// Type of elements in eighth input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ /// The sixth source sequence.
+ /// The seventh source sequence.
+ /// The eighth source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable<(T1, T2, T3, T4, T5, T6, T7, T8)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth,
+ IEnumerable sixth,
+ IEnumerable seventh,
+ IEnumerable eighth)
+ {
+ return EquiZip(
+ first,
+ second,
+ third,
+ fourth,
+ fifth,
+ sixth,
+ seventh,
+ eighth,
+ ValueTuple.Create);
+ }
+
+ }
+}
diff --git a/MoreLinq/EquiZip.g.tt b/MoreLinq/EquiZip.g.tt
new file mode 100644
index 000000000..0a5644995
--- /dev/null
+++ b/MoreLinq/EquiZip.g.tt
@@ -0,0 +1,163 @@
+<#@ template debug="false" hostspecific="false" language="C#" #>
+<#@ output extension=".cs" #>
+<#@ assembly name="System.Core" #>
+<#@ assembly name="System.Collections" #>
+<#@ import namespace="System.Globalization" #>
+<#@ import namespace="System.Linq" #>
+#region License and Terms
+// MoreLINQ - Extensions to LINQ to Objects
+// Copyright (c) 2019 Pierre Lando. All rights reserved.
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#endregion
+
+<#
+ var ordinals = new[]
+ {
+ "",
+ "first", "second", "third", "fourth",
+ "fifth", "sixth", "seventh", "eighth"
+ };
+
+ var overloads =
+ Enumerable.Range(2, 7)
+ .Select(argCount =>
+ Enumerable.Range(1, argCount).Select(argPosition =>
+ new
+ {
+ IsFirst = argPosition == 1,
+ IsLast = argPosition == argCount,
+ Name = ordinals[argPosition],
+ Ordinal = ordinals[argPosition],
+ Type = $"T{argPosition}",
+ // Objects associated with the argument
+ Enumerator = $"e{argPosition}",
+ Value = $"v{argPosition}"
+ }))
+ .Select(args => args.ToList())
+ .Select(args =>
+ new
+ {
+ Arguments = args,
+ TParams = string.Join(", ", args.Select(arg => arg.Type))
+ });
+#>
+namespace MoreLinq
+{
+ using System;
+ using System.Collections.Generic;
+
+ static partial class MoreEnumerable
+ {
+<# foreach (var o in overloads)
+ {
+#>
+ ///
+ /// Returns a projection of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+<# foreach (var arg in o.Arguments) { #>
+ /// Type of elements in <#=arg.Name#> input sequence.
+<# } #>
+ /// Type of elements in result sequence.
+<# foreach (var arg in o.Arguments) { #>
+ /// The <#=arg.Ordinal#> source sequence.
+<# } #>
+ ///
+ /// Function to apply to each tuple of elements.
+ ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable EquiZip<<#=o.TParams#>, TResult>(
+<# foreach (var arg in o.Arguments) { #>
+ <#= arg.IsFirst ? "this " : "" #>IEnumerable<<#=arg.Type#>> <#=arg.Name#>,
+<# } #>
+ Func<<#=o.TParams#>, TResult> resultSelector)
+ {
+<# foreach (var arg in o.Arguments) { #>
+ if (<#=arg.Name#> == null) throw new ArgumentNullException(nameof(<#=arg.Name#>));
+<# } #>
+ if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector));
+
+ return _(); IEnumerable _()
+ {
+<# foreach (var arg in o.Arguments) { #>
+ using var <#=arg.Enumerator#> = <#=arg.Name#>.GetEnumerator();
+<# } #>
+
+ for (;;)
+ {
+ if (<#=o.Arguments.First().Enumerator#>.MoveNext())
+ {
+ if (<# foreach (var arg in o.Arguments.Skip(1)) { #><#=arg.Enumerator#>.MoveNext()<#= arg.IsLast ? "" : " && " #><#}#>)
+ yield return resultSelector(<# foreach (var arg in o.Arguments) { #><#=arg.Enumerator#>.Current<#= arg.IsLast ? "" : ", " #><#}#>);
+ else
+ break;
+ }
+ else
+ {
+ if (<# foreach (var arg in o.Arguments.Skip(1)) { #><#=arg.Enumerator#>.MoveNext()<#= arg.IsLast ? "" : " || " #><#}#>)
+ break;
+ else
+ yield break;
+ }
+ }
+
+ throw new InvalidOperationException($"Sequences differ in length.");
+ }
+ }
+
+ ///
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+<# foreach (var arg in o.Arguments) { #>
+ /// Type of elements in <#=arg.Name#> input sequence.
+<# } #>
+<# foreach (var arg in o.Arguments) { #>
+ /// The <#=arg.Ordinal#> source sequence.
+<# } #>
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable<(<#=o.TParams#>)> EquiZip<<#=o.TParams#>>(
+<# foreach (var arg in o.Arguments) { #>
+ <#= arg.IsFirst ? "this " : "" #>IEnumerable<<#=arg.Type#>> <#=arg.Name#><#= arg.IsLast ? ")" : "," #>
+<# } #>
+ {
+ return EquiZip(
+<# foreach (var arg in o.Arguments) { #>
+ <#=arg.Name#>,
+<# } #>
+ ValueTuple.Create);
+ }
+
+<# } #>
+ }
+}
diff --git a/MoreLinq/Extensions.g.cs b/MoreLinq/Extensions.g.cs
index 9c0485718..a1499c011 100644
--- a/MoreLinq/Extensions.g.cs
+++ b/MoreLinq/Extensions.g.cs
@@ -650,7 +650,21 @@ public static partial class BatchExtension
/// Size of buckets.
/// A sequence of equally sized buckets containing elements of the source collection.
///
- /// This operator uses deferred execution and streams its results (buckets and bucket content).
+ ///
+ /// This operator uses deferred execution and streams its results
+ /// (buckets are streamed but their content buffered).
+ ///
+ /// When more than one bucket is streamed, all buckets except the last
+ /// is guaranteed to have elements. The last
+ /// bucket may be smaller depending on the remaining elements in the
+ /// sequence.
+ ///
+ /// Each bucket is pre-allocated to elements.
+ /// If is set to a very large value, e.g.
+ /// to effectively disable batching by just
+ /// hoping for a single bucket, then it can lead to memory exhaustion
+ /// ().
+ ///
///
public static IEnumerable> Batch(this IEnumerable source, int size)
@@ -665,9 +679,21 @@ public static IEnumerable> Batch(this IEnumerable<
/// Size of buckets.
/// The projection to apply to each bucket.
/// A sequence of projections on equally sized buckets containing elements of the source collection.
- ///
- /// This operator uses deferred execution and streams its results (buckets and bucket content).
- ///
+ ///
+ /// This operator uses deferred execution and streams its results
+ /// (buckets are streamed but their content buffered).
+ ///
+ ///
+ /// When more than one bucket is streamed, all buckets except the last
+ /// is guaranteed to have elements. The last
+ /// bucket may be smaller depending on the remaining elements in the
+ /// sequence.
+ /// Each bucket is pre-allocated to elements.
+ /// If is set to a very large value, e.g.
+ /// to effectively disable batching by just
+ /// hoping for a single bucket, then it can lead to memory exhaustion
+ /// ().
+ ///
public static IEnumerable Batch(this IEnumerable source, int size,
Func, TResult> resultSelector)
@@ -1298,240 +1324,607 @@ public static bool EndsWith(this IEnumerable first, IEnumerable second,
[GeneratedCode("MoreLinq.ExtensionsGenerator", "1.0.0.0")]
public static partial class EquiZipExtension
{
+
+ ///
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable<(T1, T2)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second)
+ => MoreEnumerable.EquiZip(first, second);
+
+ ///
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable<(T1, T2, T3)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third)
+ => MoreEnumerable.EquiZip(first, second, third);
///
/// Returns a projection of tuples, where each tuple contains the N-th
- /// element from each of the argument sequences. An exception is thrown
+ /// element from each of the input sequences. An exception is thrown
/// if the input sequences are of different lengths.
///
- /// Type of elements in first sequence.
- /// Type of elements in second sequence.
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
/// Type of elements in result sequence.
- /// The first sequence.
- /// The second sequence.
+ /// The first source sequence.
+ /// The second source sequence.
///
- /// Function to apply to each pair of elements.
+ /// Function to apply to each tuple of elements.
///
- /// A sequence that contains elements of the two input sequences,
- /// combined by .
- ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
///
/// The input sequences are of different lengths.
///
- ///
- /// n + l);
- /// ]]>
- /// The zipped variable, when iterated over, will yield "1A",
- /// "2B", "3C", "4D" in turn.
- ///
///
/// This operator uses deferred execution and streams its results.
///
- public static IEnumerable EquiZip(
- this IEnumerable first,
- IEnumerable second,
- Func resultSelector)
+ public static IEnumerable EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ Func resultSelector)
=> MoreEnumerable.EquiZip(first, second, resultSelector);
+ ///
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable<(T1, T2, T3, T4)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth)
+ => MoreEnumerable.EquiZip(first, second, third, fourth);
+
///
/// Returns a projection of tuples, where each tuple contains the N-th
- /// element from each of the argument sequences. An exception is thrown
+ /// element from each of the input sequences. An exception is thrown
/// if the input sequences are of different lengths.
///
- /// Type of elements in first sequence.
- /// Type of elements in second sequence.
- /// Type of elements in third sequence.
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
/// Type of elements in result sequence.
- /// The first sequence.
- /// The second sequence.
- /// The third sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
///
- /// Function to apply to each triplet of elements.
+ /// Function to apply to each tuple of elements.
///
- /// A sequence that contains elements of the three input sequences,
- /// combined by .
- ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
///
/// The input sequences are of different lengths.
///
- ///
- /// n + l + c);
- /// ]]>
- /// The zipped variable, when iterated over, will yield "1Aa",
- /// "2Bb", "3Cc", "4Dd" in turn.
- ///
///
/// This operator uses deferred execution and streams its results.
///
public static IEnumerable EquiZip(
this IEnumerable first,
- IEnumerable second, IEnumerable third,
+ IEnumerable second,
+ IEnumerable third,
Func resultSelector)
=> MoreEnumerable.EquiZip(first, second, third, resultSelector);
+ ///
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable<(T1, T2, T3, T4, T5)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth)
+ => MoreEnumerable.EquiZip(first, second, third, fourth, fifth);
+
///
/// Returns a projection of tuples, where each tuple contains the N-th
- /// element from each of the argument sequences. An exception is thrown
+ /// element from each of the input sequences. An exception is thrown
/// if the input sequences are of different lengths.
///
- /// Type of elements in first sequence
- /// Type of elements in second sequence
- /// Type of elements in third sequence
- /// Type of elements in fourth sequence
- /// Type of elements in result sequence
- /// The first sequence.
- /// The second sequence.
- /// The third sequence.
- /// The fourth sequence.
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in result sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
///
- /// Function to apply to each quadruplet of elements.
+ /// Function to apply to each tuple of elements.
///
- /// A sequence that contains elements of the four input sequences,
- /// combined by .
- ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
///
/// The input sequences are of different lengths.
///
- ///
- /// n + l + c + f);
- /// ]]>
- /// The zipped variable, when iterated over, will yield "1AaTrue",
- /// "2BbFalse", "3CcTrue", "4DdFalse" in turn.
- ///
///
/// This operator uses deferred execution and streams its results.
///
public static IEnumerable EquiZip(
this IEnumerable first,
- IEnumerable second, IEnumerable third, IEnumerable fourth,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
Func resultSelector)
=> MoreEnumerable.EquiZip(first, second, third, fourth, resultSelector);
- }
-
- /// Evaluate extension.
-
- [GeneratedCode("MoreLinq.ExtensionsGenerator", "1.0.0.0")]
- public static partial class EvaluateExtension
- {
///
- /// Returns a sequence containing the values resulting from invoking (in order) each function in the source sequence of functions.
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// Type of elements in sixth input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ /// The sixth source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
///
- /// This operator uses deferred execution and streams the results.
- /// If the resulting sequence is enumerated multiple times, the functions will be
- /// evaluated multiple times too.
+ /// This operator uses deferred execution and streams its results.
///
- /// The type of the object returned by the functions.
- /// The functions to evaluate.
- /// A sequence with results from invoking .
- /// When is null.
-
- public static IEnumerable Evaluate(this IEnumerable> functions) => MoreEnumerable.Evaluate(functions);
- }
-
- /// Exactly extension.
-
- [GeneratedCode("MoreLinq.ExtensionsGenerator", "1.0.0.0")]
- public static partial class ExactlyExtension
- {
+ public static IEnumerable<(T1, T2, T3, T4, T5, T6)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth,
+ IEnumerable sixth)
+ => MoreEnumerable.EquiZip(first, second, third, fourth, fifth, sixth);
///
- /// Determines whether or not the number of elements in the sequence is equals to the given integer.
+ /// Returns a projection of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
///
- /// Element type of sequence
- /// The source sequence
- /// The exactly number of items a sequence must have for this
- /// function to return true
- /// is null
- /// is negative
- /// true if the number of elements in the sequence is equals
- /// to the given integer or false otherwise.
- ///
- ///
- /// The result variable will contain true.
- ///
-
- public static bool Exactly(this IEnumerable source, int count)
- => MoreEnumerable.Exactly(source, count);
-
- }
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// Type of elements in result sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ ///
+ /// Function to apply to each tuple of elements.
+ ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
- /// ExceptBy extension.
+ public static IEnumerable EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth,
+ Func resultSelector)
+ => MoreEnumerable.EquiZip(first, second, third, fourth, fifth, resultSelector);
- [GeneratedCode("MoreLinq.ExtensionsGenerator", "1.0.0.0")]
- public static partial class ExceptByExtension
- {
///
- /// Returns the set of elements in the first sequence which aren't
- /// in the second sequence, according to a given key selector.
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// Type of elements in sixth input sequence.
+ /// Type of elements in seventh input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ /// The sixth source sequence.
+ /// The seventh source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
///
- /// This is a set operation; if multiple elements in have
- /// equal keys, only the first such element is returned.
- /// This operator uses deferred execution and streams the results, although
- /// a set of keys from is immediately selected and retained.
+ /// This operator uses deferred execution and streams its results.
///
- /// The type of the elements in the input sequences.
- /// The type of the key returned by .
- /// The sequence of potentially included elements.
- /// The sequence of elements whose keys may prevent elements in
- /// from being returned.
- /// The mapping from source element to key.
- /// A sequence of elements from whose key was not also a key for
- /// any element in .
- public static IEnumerable ExceptBy(this IEnumerable first,
- IEnumerable second,
- Func keySelector)
- => MoreEnumerable.ExceptBy(first, second, keySelector);
+ public static IEnumerable<(T1, T2, T3, T4, T5, T6, T7)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth,
+ IEnumerable sixth,
+ IEnumerable seventh)
+ => MoreEnumerable.EquiZip(first, second, third, fourth, fifth, sixth, seventh);
///
- /// Returns the set of elements in the first sequence which aren't
- /// in the second sequence, according to a given key selector.
+ /// Returns a projection of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// Type of elements in sixth input sequence.
+ /// Type of elements in result sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ /// The sixth source sequence.
+ ///
+ /// Function to apply to each tuple of elements.
+ ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
///
- /// This is a set operation; if multiple elements in have
- /// equal keys, only the first such element is returned.
- /// This operator uses deferred execution and streams the results, although
- /// a set of keys from is immediately selected and retained.
+ /// This operator uses deferred execution and streams its results.
///
- /// The type of the elements in the input sequences.
- /// The type of the key returned by .
- /// The sequence of potentially included elements.
- /// The sequence of elements whose keys may prevent elements in
- /// from being returned.
- /// The mapping from source element to key.
- /// The equality comparer to use to determine whether or not keys are equal.
- /// If null, the default equality comparer for TSource is used.
- /// A sequence of elements from whose key was not also a key for
- /// any element in .
-
- public static IEnumerable ExceptBy(this IEnumerable first,
- IEnumerable second,
- Func keySelector,
- IEqualityComparer keyComparer)
- => MoreEnumerable.ExceptBy(first, second, keySelector, keyComparer);
- }
+ public static IEnumerable EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth,
+ IEnumerable sixth,
+ Func resultSelector)
+ => MoreEnumerable.EquiZip(first, second, third, fourth, fifth, sixth, resultSelector);
+
+ ///
+ /// Returns a sequence of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// Type of elements in sixth input sequence.
+ /// Type of elements in seventh input sequence.
+ /// Type of elements in eighth input sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ /// The sixth source sequence.
+ /// The seventh source sequence.
+ /// The eighth source sequence.
+ ///
+ /// A sequence of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable<(T1, T2, T3, T4, T5, T6, T7, T8)> EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable fourth,
+ IEnumerable fifth,
+ IEnumerable sixth,
+ IEnumerable seventh,
+ IEnumerable eighth)
+ => MoreEnumerable.EquiZip(first, second, third, fourth, fifth, sixth, seventh, eighth);
+
+ ///
+ /// Returns a projection of tuples, where each tuple contains the N-th
+ /// element from each of the input sequences. An exception is thrown
+ /// if the input sequences are of different lengths.
+ ///
+ /// Type of elements in first input sequence.
+ /// Type of elements in second input sequence.
+ /// Type of elements in third input sequence.
+ /// Type of elements in fourth input sequence.
+ /// Type of elements in fifth input sequence.
+ /// Type of elements in sixth input sequence.
+ /// Type of elements in seventh input sequence.
+ /// Type of elements in result sequence.
+ /// The first source sequence.
+ /// The second source sequence.
+ /// The third source sequence.
+ /// The fourth source sequence.
+ /// The fifth source sequence.
+ /// The sixth source sequence.
+ /// The seventh source sequence.
+ ///
+ /// Function to apply to each tuple of elements.
+ ///
+ /// A projection of tuples, where each tuple contains the N-th element
+ /// from each of the argument sequences.
+ ///
+ /// The input sequences are of different lengths.
+ ///
+ ///
+ /// This operator uses deferred execution and streams its results.
+ ///
+
+ public static IEnumerable EquiZip(
+ this IEnumerable first,
+ IEnumerable second,
+ IEnumerable third,
+ IEnumerable