diff --git a/MoreLinq.Test/PairwiseTest.cs b/MoreLinq.Test/PairwiseTest.cs index 5dace66b8..004538b74 100644 --- a/MoreLinq.Test/PairwiseTest.cs +++ b/MoreLinq.Test/PairwiseTest.cs @@ -20,30 +20,60 @@ namespace MoreLinq.Test using NUnit.Framework; [TestFixture] - public class PairwiseTest + public static class PairwiseTest { - [Test] - public void PairwiseIsLazy() + public class ReturningTuples { - _ = new BreakingSequence().Pairwise(BreakingFunc.Of()); - } + [Test] + public void PairwiseIsLazy() + { + _ = new BreakingSequence().Pairwise(); + } - [TestCase(0)] - [TestCase(1)] - public void PairwiseWithSequenceShorterThanTwo(int count) - { - var source = Enumerable.Range(0, count); - var result = source.Pairwise(BreakingFunc.Of()); + [TestCase(0)] + [TestCase(1)] + public void PairwiseWithSequenceShorterThanTwo(int count) + { + var source = Enumerable.Range(0, count); + var result = source.Pairwise(); + + Assert.That(result, Is.Empty); + } - Assert.That(result, Is.Empty); + [Test] + public void PairwiseWideSourceSequence() + { + using var source = new[] { "a", "b", "c", "d" }.AsTestingSequence(); + var result = source.Pairwise(); + result.AssertSequenceEqual(("a", "b"), ("b", "c"), ("c", "d")); + } } - [Test] - public void PairwiseWideSourceSequence() + public class ReturningSomeResults { - using var source = new[] { "a", "b", "c", "d" }.AsTestingSequence(); - var result = source.Pairwise((x, y) => x + y); - result.AssertSequenceEqual("ab", "bc", "cd"); + [Test] + public void PairwiseIsLazy() + { + _ = new BreakingSequence().Pairwise(BreakingFunc.Of()); + } + + [TestCase(0)] + [TestCase(1)] + public void PairwiseWithSequenceShorterThanTwo(int count) + { + var source = Enumerable.Range(0, count); + var result = source.Pairwise(BreakingFunc.Of()); + + Assert.That(result, Is.Empty); + } + + [Test] + public void PairwiseWideSourceSequence() + { + using var source = new[] { "a", "b", "c", "d" }.AsTestingSequence(); + var result = source.Pairwise((x, y) => x + y); + result.AssertSequenceEqual("ab", "bc", "cd"); + } } } } diff --git a/MoreLinq/Cartesian.g.cs b/MoreLinq/Cartesian.g.cs index 64694c065..23c094d39 100644 --- a/MoreLinq/Cartesian.g.cs +++ b/MoreLinq/Cartesian.g.cs @@ -82,6 +82,33 @@ public static IEnumerable Cartesian( } } + /// + /// Returns the Cartesian product of two sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second)> + Cartesian( + this IEnumerable first, + IEnumerable second) + { + return Cartesian(first, second, ValueTuple.Create); + } + /// /// Returns the Cartesian product of three sequences by enumerating all /// possible combinations of one item from each sequence, and applying @@ -139,6 +166,36 @@ public static IEnumerable Cartesian( } } + /// + /// Returns the Cartesian product of three sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// The third sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second, T3 Third)> + Cartesian( + this IEnumerable first, + IEnumerable second, + IEnumerable third) + { + return Cartesian(first, second, third, ValueTuple.Create); + } + /// /// Returns the Cartesian product of four sequences by enumerating all /// possible combinations of one item from each sequence, and applying @@ -204,6 +261,39 @@ public static IEnumerable Cartesian( } } + /// + /// Returns the Cartesian product of four sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// The third sequence of elements. + /// The fourth sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth)> + Cartesian( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth) + { + return Cartesian(first, second, third, fourth, ValueTuple.Create); + } + /// /// Returns the Cartesian product of five sequences by enumerating all /// possible combinations of one item from each sequence, and applying @@ -277,6 +367,42 @@ public static IEnumerable Cartesian( } } + /// + /// Returns the Cartesian product of five sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// The third sequence of elements. + /// The fourth sequence of elements. + /// The fifth sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth)> + Cartesian( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth, + IEnumerable fifth) + { + return Cartesian(first, second, third, fourth, fifth, ValueTuple.Create); + } + /// /// Returns the Cartesian product of six sequences by enumerating all /// possible combinations of one item from each sequence, and applying @@ -358,6 +484,45 @@ public static IEnumerable Cartesian( } } + /// + /// Returns the Cartesian product of six sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// The third sequence of elements. + /// The fourth sequence of elements. + /// The fifth sequence of elements. + /// The sixth sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth)> + Cartesian( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth, + IEnumerable fifth, + IEnumerable sixth) + { + return Cartesian(first, second, third, fourth, fifth, sixth, ValueTuple.Create); + } + /// /// Returns the Cartesian product of seven sequences by enumerating all /// possible combinations of one item from each sequence, and applying @@ -447,6 +612,48 @@ public static IEnumerable Cartesian + /// Returns the Cartesian product of seven sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// The third sequence of elements. + /// The fourth sequence of elements. + /// The fifth sequence of elements. + /// The sixth sequence of elements. + /// The seventh sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh)> + Cartesian( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth, + IEnumerable fifth, + IEnumerable sixth, + IEnumerable seventh) + { + return Cartesian(first, second, third, fourth, fifth, sixth, seventh, ValueTuple.Create); + } + /// /// Returns the Cartesian product of eight sequences by enumerating all /// possible combinations of one item from each sequence, and applying @@ -543,5 +750,50 @@ public static IEnumerable Cartesian + /// Returns the Cartesian product of eight sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// The third sequence of elements. + /// The fourth sequence of elements. + /// The fifth sequence of elements. + /// The sixth sequence of elements. + /// The seventh sequence of elements. + /// The eighth sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh, T8 Eighth)> + Cartesian( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth, + IEnumerable fifth, + IEnumerable sixth, + IEnumerable seventh, + IEnumerable eighth) + { + return Cartesian(first, second, third, fourth, fifth, sixth, seventh, eighth, ValueTuple.Create); + } } } diff --git a/MoreLinq/Cartesian.g.tt b/MoreLinq/Cartesian.g.tt index 4bc112cea..b6ebf8510 100644 --- a/MoreLinq/Cartesian.g.tt +++ b/MoreLinq/Cartesian.g.tt @@ -43,19 +43,20 @@ namespace MoreLinq { new[] { - new { Ordinal = "first" , Arity = "one" }, - new { Ordinal = "second" , Arity = "two" }, - new { Ordinal = "third" , Arity = "three" }, - new { Ordinal = "fourth" , Arity = "four" }, - new { Ordinal = "fifth" , Arity = "five" }, - new { Ordinal = "sixth" , Arity = "six" }, - new { Ordinal = "seventh", Arity = "seven" }, - new { Ordinal = "eighth" , Arity = "eight" }, + new { Ordinal = "First" , Arity = "one" }, + new { Ordinal = "Second" , Arity = "two" }, + new { Ordinal = "Third" , Arity = "three" }, + new { Ordinal = "Fourth" , Arity = "four" }, + new { Ordinal = "Fifth" , Arity = "five" }, + new { Ordinal = "Sixth" , Arity = "six" }, + new { Ordinal = "Seventh", Arity = "seven" }, + new { Ordinal = "Eighth" , Arity = "eight" }, } } select args.Select((a, i) => new { a.Ordinal, + OrdinalLower = a.Ordinal.ToLowerInvariant(), a.Arity, Count = i + 1, Number = (i + 1).ToString(CultureInfo.InvariantCulture), @@ -66,9 +67,8 @@ namespace MoreLinq select new { a.Arity, - Arguments = args.Take(a.Count) - .Select(aa => new { aa.Number, aa.Ordinal }) - .ToList(), + Arguments = args.Take(a.Count).ToList(), + TypeParams = string.Join(", ", from aa in args.Take(a.Count) select $"T{aa.Number}") }; foreach (var o in overloads) @@ -81,12 +81,12 @@ namespace MoreLinq /// <# foreach (var arg in o.Arguments) { #> /// - /// The type of the elements of . + /// The type of the elements of . <# } #> /// /// The type of the elements of the result sequence. <# foreach (var arg in o.Arguments) {#> - /// The <#= arg.Ordinal #> sequence of elements. + /// The <#= arg.OrdinalLower #> sequence of elements. <# } #> /// A projection function that combines /// elements from all of the sequences. @@ -102,37 +102,67 @@ namespace MoreLinq /// This method uses deferred execution and stream its results. /// - public static IEnumerable Cartesian<<#= string.Join(", ", from x in o.Arguments select "T" + x.Number) #>, TResult>( + public static IEnumerable Cartesian<<#= o.TypeParams #>, TResult>( this <# foreach (var arg in o.Arguments) { #> -IEnumerable> <#= arg.Ordinal #>, +IEnumerable> <#= arg.OrdinalLower #>, <# } #> -Func<<#= string.Join(", ", from x in o.Arguments select "T" + x.Number) #>, TResult> resultSelector) +Func<<#= o.TypeParams #>, TResult> resultSelector) { <# foreach (var arg in o.Arguments) { #> - if (<#= arg.Ordinal #> == null) throw new ArgumentNullException(nameof(<#= arg.Ordinal #>)); + if (<#= arg.OrdinalLower #> == null) throw new ArgumentNullException(nameof(<#= arg.OrdinalLower #>)); <# } #> if (resultSelector == null) throw new ArgumentNullException(nameof(resultSelector)); return _(); IEnumerable _() { <# foreach (var arg in o.Arguments.Skip(1)) { #> - IEnumerable> <#= arg.Ordinal #>Memo; + IEnumerable> <#= arg.OrdinalLower #>Memo; <# } #> <# foreach (var arg in o.Arguments.Skip(1)) { #> - using ((<#= arg.Ordinal #>Memo = <#= arg.Ordinal #>.Memoize()) as IDisposable) + using ((<#= arg.OrdinalLower #>Memo = <#= arg.OrdinalLower #>.Memoize()) as IDisposable) <# } #> { foreach (var item1 in first) <# foreach (var arg in o.Arguments.Skip(1)) { #> - foreach (var item<#= arg.Number #> in <#= arg.Ordinal #>Memo) + foreach (var item<#= arg.Number #> in <#= arg.OrdinalLower #>Memo) <# } #> yield return resultSelector(<#= string.Join(", ", from x in o.Arguments select "item" + x.Number) #>); } } } + + /// + /// Returns the Cartesian product of <#= o.Arity #> sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// +<# foreach (var arg in o.Arguments) { #> + /// The type of the elements of . +<# } #> +<# foreach (var arg in o.Arguments) {#> + /// The <#= arg.OrdinalLower #> sequence of elements. +<# } #> + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(<#= string.Join(", ", from a in o.Arguments select $"T{a.Number} {a.Ordinal}") #>)> + Cartesian<<#= o.TypeParams #>>( + this <#= string.Join($",{Environment.NewLine} ", + from arg in o.Arguments + select $"IEnumerable {arg.OrdinalLower}") #>) + { + return Cartesian(<#= string.Join(", ", from a in o.Arguments select a.OrdinalLower) #>, ValueTuple.Create); + } <# } #> } } diff --git a/MoreLinq/CountDown.cs b/MoreLinq/CountDown.cs index 53310e79a..1e0ca6d4f 100644 --- a/MoreLinq/CountDown.cs +++ b/MoreLinq/CountDown.cs @@ -94,5 +94,31 @@ IEnumerable IterateSequence() yield return resultSelector(queue.Dequeue(), queue.Count); } } + + /// + /// Provides a countdown counter for a given count of elements at the + /// tail of the sequence where zero always represents the last element, + /// one represents the second-last element, two represents the + /// third-last element and so on. + /// + /// + /// The type of elements of + /// The source sequence. + /// Count of tail elements of to count down. + /// + /// A sequence of tuple with an element from and its countdown. + /// For elements before the last , the countdown value is null. + /// + /// + /// This method uses deferred execution semantics and streams its + /// results. At most, elements of the source + /// sequence may be buffered at any one time unless + /// is a collection or a list. + /// + + public static IEnumerable<(T Item, int? CountDown)> CountDown(this IEnumerable source, int count) + { + return source.CountDown(count, ValueTuple.Create); + } } } diff --git a/MoreLinq/EquiZip.cs b/MoreLinq/EquiZip.cs index 61212f122..5c09d8079 100644 --- a/MoreLinq/EquiZip.cs +++ b/MoreLinq/EquiZip.cs @@ -181,6 +181,118 @@ public static IEnumerable EquiZip( return EquiZipImpl(first, second, third, fourth, resultSelector); } + /// + /// Returns 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 + /// The first sequence. + /// The second sequence. + /// + /// A sequence of tuples that contains elements of the two input sequences. + /// + /// + /// The input sequences are of different lengths. + /// + /// + /// + /// The zipped variable, when iterated over, will yield the tuples : (1, A), + /// (2, B), (3, C), (4, D) in turn. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(T1, T2)> EquiZip(this IEnumerable first, IEnumerable second) + { + return first.EquiZip(second, ValueTuple.Create); + } + + /// + /// Returns 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 + /// The first sequence. + /// The second sequence. + /// The third sequence. + /// + /// A sequence of tuples that contains elements of the three input sequences. + /// + /// + /// The input sequences are of different lengths. + /// + /// + /// + /// The zipped variable, when iterated over, will yield the tuples : (1, A, a), + /// (2, B, b), (3, C, c), (4, D, d) in turn. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(T1, T2, T3)> EquiZip( + this IEnumerable first, + IEnumerable second, IEnumerable third) + { + return first.EquiZip(second, third, ValueTuple.Create); + } + + /// + /// Returns 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 + /// The first sequence. + /// The second sequence. + /// The third sequence. + /// The fourth sequence. + /// + /// A sequence of tuples that contains elements of the four input sequences. + /// + /// + /// The input sequences are of different lengths. + /// + /// + /// + /// The zipped variable, when iterated over, will yield the tuples : (1, A, a, True), + /// (2, B, b, False), (3, C, c, True), (4, D, d, False) in turn. + /// + /// + /// 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 first.EquiZip(second, third, fourth, ValueTuple.Create); + } + static IEnumerable EquiZipImpl( IEnumerable s1, IEnumerable s2, diff --git a/MoreLinq/Extensions.g.cs b/MoreLinq/Extensions.g.cs index b7fcf096d..cf7d7b47e 100644 --- a/MoreLinq/Extensions.g.cs +++ b/MoreLinq/Extensions.g.cs @@ -721,6 +721,59 @@ public static IEnumerable Batch(this IEnumerable + /// Returns the Cartesian product of two sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second)> + Cartesian( + this IEnumerable first, + IEnumerable second) + => MoreEnumerable. Cartesian(first, second); + + /// + /// Returns the Cartesian product of three sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// The third sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second, T3 Third)> + Cartesian( + this IEnumerable first, + IEnumerable second, + IEnumerable third) + => MoreEnumerable. Cartesian(first, second, third); /// /// Returns the Cartesian product of two sequences by enumerating all /// possible combinations of one item from each sequence, and applying @@ -754,6 +807,37 @@ public static IEnumerable Cartesian( Func resultSelector) => MoreEnumerable.Cartesian(first, second, resultSelector); + /// + /// Returns the Cartesian product of four sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// The third sequence of elements. + /// The fourth sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth)> + Cartesian( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth) + => MoreEnumerable. Cartesian(first, second, third, fourth); + /// /// Returns the Cartesian product of three sequences by enumerating all /// possible combinations of one item from each sequence, and applying @@ -791,6 +875,40 @@ public static IEnumerable Cartesian( Func resultSelector) => MoreEnumerable.Cartesian(first, second, third, resultSelector); + /// + /// Returns the Cartesian product of five sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// The third sequence of elements. + /// The fourth sequence of elements. + /// The fifth sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth)> + Cartesian( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth, + IEnumerable fifth) + => MoreEnumerable. Cartesian(first, second, third, fourth, fifth); + /// /// Returns the Cartesian product of four sequences by enumerating all /// possible combinations of one item from each sequence, and applying @@ -832,6 +950,43 @@ public static IEnumerable Cartesian( Func resultSelector) => MoreEnumerable.Cartesian(first, second, third, fourth, resultSelector); + /// + /// Returns the Cartesian product of six sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// The third sequence of elements. + /// The fourth sequence of elements. + /// The fifth sequence of elements. + /// The sixth sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth)> + Cartesian( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth, + IEnumerable fifth, + IEnumerable sixth) + => MoreEnumerable. Cartesian(first, second, third, fourth, fifth, sixth); + /// /// Returns the Cartesian product of five sequences by enumerating all /// possible combinations of one item from each sequence, and applying @@ -877,6 +1032,46 @@ public static IEnumerable Cartesian( Func resultSelector) => MoreEnumerable.Cartesian(first, second, third, fourth, fifth, resultSelector); + /// + /// Returns the Cartesian product of seven sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// The third sequence of elements. + /// The fourth sequence of elements. + /// The fifth sequence of elements. + /// The sixth sequence of elements. + /// The seventh sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh)> + Cartesian( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth, + IEnumerable fifth, + IEnumerable sixth, + IEnumerable seventh) + => MoreEnumerable. Cartesian(first, second, third, fourth, fifth, sixth, seventh); + /// /// Returns the Cartesian product of six sequences by enumerating all /// possible combinations of one item from each sequence, and applying @@ -926,6 +1121,49 @@ public static IEnumerable Cartesian( Func resultSelector) => MoreEnumerable.Cartesian(first, second, third, fourth, fifth, sixth, resultSelector); + /// + /// Returns the Cartesian product of eight sequences by enumerating tuples + /// of all possible combinations of one item from each sequence. + /// + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The type of the elements of . + /// The first sequence of elements. + /// The second sequence of elements. + /// The third sequence of elements. + /// The fourth sequence of elements. + /// The fifth sequence of elements. + /// The sixth sequence of elements. + /// The seventh sequence of elements. + /// The eighth sequence of elements. + /// A sequence of tuples. + /// + /// + /// The method returns items in the same order as a nested foreach + /// loop, but all sequences except for are + /// cached when iterated over. The cache is then re-used for any + /// subsequent iterations. + /// + /// This method uses deferred execution and stream its results. + /// + + public static IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh, T8 Eighth)> + Cartesian( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth, + IEnumerable fifth, + IEnumerable sixth, + IEnumerable seventh, + IEnumerable eighth) + => MoreEnumerable. Cartesian(first, second, third, fourth, fifth, sixth, seventh, eighth); + /// /// Returns the Cartesian product of seven sequences by enumerating all /// possible combinations of one item from each sequence, and applying @@ -1199,6 +1437,30 @@ public static IEnumerable> CountBy(this I [GeneratedCode("MoreLinq.ExtensionsGenerator", "1.0.0.0")] public static partial class CountDownExtension { + + /// + /// Provides a countdown counter for a given count of elements at the + /// tail of the sequence where zero always represents the last element, + /// one represents the second-last element, two represents the + /// third-last element and so on. + /// + /// + /// The type of elements of + /// The source sequence. + /// Count of tail elements of to count down. + /// + /// A sequence of tuple with an element from and its countdown. + /// For elements before the last , the countdown value is null. + /// + /// + /// This method uses deferred execution semantics and streams its + /// results. At most, elements of the source + /// sequence may be buffered at any one time unless + /// is a collection or a list. + /// + + public static IEnumerable<(T Item, int? CountDown)> CountDown(this IEnumerable source, int count) + => MoreEnumerable.CountDown(source, count); /// /// Provides a countdown counter for a given count of elements at the /// tail of the sequence where zero always represents the last element, @@ -1339,6 +1601,73 @@ public static bool EndsWith(this IEnumerable first, IEnumerable second, [GeneratedCode("MoreLinq.ExtensionsGenerator", "1.0.0.0")] public static partial class EquiZipExtension { + + /// + /// Returns 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 + /// The first sequence. + /// The second sequence. + /// + /// A sequence of tuples that contains elements of the two input sequences. + /// + /// + /// The input sequences are of different lengths. + /// + /// + /// + /// The zipped variable, when iterated over, will yield the tuples : (1, A), + /// (2, B), (3, C), (4, D) in turn. + /// + /// + /// 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 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 + /// The first sequence. + /// The second sequence. + /// The third sequence. + /// + /// A sequence of tuples that contains elements of the three input sequences. + /// + /// + /// The input sequences are of different lengths. + /// + /// + /// + /// The zipped variable, when iterated over, will yield the tuples : (1, A, a), + /// (2, B, b), (3, C, c), (4, D, d) in turn. + /// + /// + /// 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 @@ -1381,6 +1710,45 @@ public static IEnumerable EquiZip( Func resultSelector) => MoreEnumerable.EquiZip(first, second, resultSelector); + /// + /// Returns 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 + /// The first sequence. + /// The second sequence. + /// The third sequence. + /// The fourth sequence. + /// + /// A sequence of tuples that contains elements of the four input sequences. + /// + /// + /// The input sequences are of different lengths. + /// + /// + /// + /// The zipped variable, when iterated over, will yield the tuples : (1, A, a, True), + /// (2, B, b, False), (3, C, c, True), (4, D, d, False) in turn. + /// + /// + /// 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 @@ -3075,6 +3443,37 @@ public static IEnumerable Interleave(this IEnumerable sequence, params [GeneratedCode("MoreLinq.ExtensionsGenerator", "1.0.0.0")] public static partial class LagExtension { + + /// + /// Produces a sequence of tuple containing a pair of elements separated by a negative offset. + /// + /// + /// This operator evaluates in a deferred and streaming manner.
+ /// For elements prior to the lag offset, default(T) is used as the lagged value.
+ ///
+ /// The type of the elements of the source sequence + /// The sequence over which to evaluate lag + /// The offset (expressed as a positive number) by which to lag each value of the sequence + /// A sequence of element of the sequence with its lagged pairing + + public static IEnumerable<(TSource Item, TSource OffsetItem)> Lag(this IEnumerable source, int offset) + => MoreEnumerable.Lag(source, offset); + + /// + /// Produces a sequence of tuple containing a pair of elements separated by a negative offset. + /// + /// + /// This operator evaluates in a deferred and streaming manner.
+ /// For elements prior to the lag offset, is used as the lagged value.
+ ///
+ /// The type of the elements of the source sequence + /// The sequence over which to evaluate lag + /// The offset (expressed as a positive number) by which to lag each value of the sequence + /// A default value supplied for the lagged value prior to the lag offset + /// A sequence of element of the sequence with its lagged pairing + + public static IEnumerable<(TSource Item, TSource OffsetItem)> Lag(this IEnumerable source, int offset, TSource defaultLagValue) + => MoreEnumerable.Lag(source, offset, defaultLagValue); /// /// Produces a projection of a sequence by evaluating pairs of elements separated by a /// negative offset. @@ -3176,6 +3575,37 @@ public static partial class LastOrDefaultExtension [GeneratedCode("MoreLinq.ExtensionsGenerator", "1.0.0.0")] public static partial class LeadExtension { + + /// + /// Produces a sequence of tuple containing a pair of elements separated by a positive offset. + /// + /// + /// This operator evaluates in a deferred and streaming manner.
+ /// For elements of the sequence that are less than items from the end, + /// default(T) is used as the lead value.
+ ///
+ /// The type of the elements in the source sequence + /// The sequence over which to evaluate Lead + /// The offset (expressed as a positive number) by which to lead each element of the sequence + /// The produced sequence of tuple + + public static IEnumerable<(TSource Item, TSource? OffsetItem)> Lead(this IEnumerable source, int offset) + => MoreEnumerable.Lead(source, offset); + + /// + /// Produces a sequence of tuple containing a pair of elements separated by a positive offset. + /// + /// + /// This operator evaluates in a deferred and streaming manner.
+ ///
+ /// The type of the elements in the source sequence + /// The sequence over which to evaluate Lead + /// The offset (expressed as a positive number) by which to lead each element of the sequence + /// A default value supplied for the leading element when none is available + /// The produced sequence of tuple + + public static IEnumerable<(TSource Item, TSource OffsetItem)> Lead(this IEnumerable source, int offset, TSource defaultLeadValue) + => MoreEnumerable.Lead(source, offset, defaultLeadValue); /// /// Produces a projection of a sequence by evaluating pairs of elements separated by a /// positive offset. @@ -4093,6 +4523,25 @@ public static IEnumerable PadStart(this IEnumerable s [GeneratedCode("MoreLinq.ExtensionsGenerator", "1.0.0.0")] public static partial class PairwiseExtension { + /// + /// Returns a sequence where each element in the source sequence is + /// paired with its predecessor, with the exception of the first + /// element which is only returned as the predecessor of the second + /// element. + /// + /// + /// The type of the elements of . + /// The source sequence. + /// + /// Returns the resulting sequence. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(TSource, TSource)> + Pairwise(this IEnumerable source) => MoreEnumerable. Pairwise(source); + /// /// Returns a sequence resulting from applying a function to each /// element in the source sequence and its @@ -5888,6 +6337,32 @@ public static IEnumerable> Subsets(this IEnumerable sequence, int [GeneratedCode("MoreLinq.ExtensionsGenerator", "1.0.0.0")] public static partial class TagFirstLastExtension { + + /// + /// Returns a sequence of tuples, where the N-th tuple contains the N-th + /// element of the source sequence and two booleans indicating whether the + /// element is the first and/or last. + /// + /// The type of the elements of . + /// The source sequence. + /// + /// Returns the resulting sequence. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + /// + /// + /// The result variable, when iterated over, will yield + /// (123, True, False), (456, False, False) and + /// (789, False, True) in turn. + /// + + public static IEnumerable<(TSource Item, bool IsFirst, bool IsLast)> TagFirstLast(this IEnumerable source) + => MoreEnumerable.TagFirstLast(source); /// /// Returns a sequence resulting from applying a function to each /// element in the source sequence with additional parameters @@ -6996,6 +7471,74 @@ public static IEnumerable> WindowRight(this IEnumerable< [GeneratedCode("MoreLinq.ExtensionsGenerator", "1.0.0.0")] public static partial class ZipLongestExtension { + + /// + /// Returns a sequence of tuples, where each tuple contains the N-th + /// element from each of the argument sequences. The resulting sequence + /// will always be as long as the longest of input sequences where the + /// default value of each of the shorter sequence element types is used + /// for padding. + /// + /// Type of elements in first sequence. + /// Type of elements in second sequence. + /// The first sequence. + /// The second sequence. + /// + /// A sequence of tuples that contains elements of the two input sequences. + /// + /// + /// + /// The zipped variable, when iterated over, will yield the tuples : (1, A), + /// (2, B), (3, C), (0, D) in turn. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(TFirst, TSecond)> ZipLongest( + this IEnumerable first, + IEnumerable second) + => MoreEnumerable.ZipLongest(first, second); + + /// + /// Returns a sequence of tuples, where each tuple contains the N-th + /// element from each of the argument sequences. The resulting sequence + /// will always be as long as the longest of input sequences where the + /// default value of each of the shorter sequence element types is used + /// for padding. + /// + /// Type of elements in first sequence. + /// Type of elements in second sequence. + /// Type of elements in third sequence. + /// The first sequence. + /// The second sequence. + /// The third sequence. + /// + /// A sequence of tuples that contains elements of the three input sequences. + /// + /// + /// + /// The zipped variable, when iterated over, will yield (1, "A", 'a'), + /// (2, "B", 'b'), (3, "C", 'c'), (0, "D", 'd'), (0, , 'e') in turn. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(T1, T2, T3)> ZipLongest( + this IEnumerable first, + IEnumerable second, + IEnumerable third) + => MoreEnumerable.ZipLongest(first, second, third); /// /// Returns a projection of tuples, where each tuple contains the N-th /// element from each of the argument sequences. The resulting sequence @@ -7037,6 +7580,47 @@ public static IEnumerable ZipLongest( Func resultSelector) => MoreEnumerable.ZipLongest(first, second, resultSelector); + /// + /// Returns a sequence of tuples, where each tuple contains the N-th + /// element from each of the argument sequences. The resulting sequence + /// will always be as long as the longest of input sequences where the + /// default value of each of the shorter sequence element types is used + /// for padding. + /// + /// Type of elements in first sequence + /// Type of elements in second sequence + /// Type of elements in third sequence + /// Type of elements in fourth sequence + /// The first sequence. + /// The second sequence. + /// The third sequence. + /// The fourth sequence. + /// + /// A sequence of tuples that contains elements of the four input sequences. + /// + /// + /// + /// The zipped variable, when iterated over, will yield (1, "A", 'a', ), + /// (2, "B", 'b', ), (3, "C", 'c', ), (0, "D", 'd', ), + /// (0, , 'e', ), (0, , '\0', ) in turn. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(T1, T2, T3, T4)> ZipLongest( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth) + => MoreEnumerable.ZipLongest(first, second, third, fourth); + /// /// Returns a projection of tuples, where each tuple contains the N-th /// element from each of the argument sequences. The resulting sequence @@ -7140,6 +7724,82 @@ public static IEnumerable ZipLongest( [GeneratedCode("MoreLinq.ExtensionsGenerator", "1.0.0.0")] public static partial class ZipShortestExtension { + + /// + /// Returns a sequence of tuples, where each tuple contains the N-th + /// element from each of the argument sequences. The resulting sequence + /// is as short as the shortest input sequence. + /// + /// Type of elements in first sequence. + /// Type of elements in second sequence. + /// The first sequence. + /// The second sequence. + /// + /// A sequence of tuples that contains elements of the two input sequences. + /// + /// + /// + /// The zipped variable, when iterated over, will yield + /// (1, "A"), (2, "B"), (3, "C") in turn. + /// + /// + /// + /// If the input sequences are of different lengths, the result sequence + /// is terminated as soon as the shortest input sequence is exhausted + /// and remainder elements from the longer sequences are never consumed. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(TFirst, TSecond)> ZipShortest( + this IEnumerable first, + IEnumerable second) + => MoreEnumerable.ZipShortest(first, second); + + /// + /// Returns a sequence of tuples, where each tuple contains the N-th + /// element from each of the argument sequences. The resulting sequence + /// is as short as the shortest input sequence. + /// + /// Type of elements in first sequence. + /// Type of elements in second sequence. + /// Type of elements in third sequence. + /// First sequence + /// Second sequence + /// Third sequence + /// + /// A sequence of tuples that contains elements of the three input sequences. + /// + /// + /// + /// The zipped variable, when iterated over, will yield + /// (1, "A", 'a'), (2, "B", 'b'), (3, "C", 'c') in turn. + /// + /// + /// + /// If the input sequences are of different lengths, the result sequence + /// is terminated as soon as the shortest input sequence is exhausted + /// and remainder elements from the longer sequences are never consumed. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(T1, T2, T3)> ZipShortest( + this IEnumerable first, + IEnumerable second, + IEnumerable third) + => MoreEnumerable.ZipShortest(first, second, third); /// /// Returns a projection of tuples, where each tuple contains the N-th /// element from each of the argument sequences. The resulting sequence @@ -7183,6 +7843,50 @@ public static IEnumerable ZipShortest( Func resultSelector) => MoreEnumerable.ZipShortest(first, second, resultSelector); + /// + /// Returns a sequence of tuples, where each tuple contains the N-th + /// element from each of the argument sequences. The resulting sequence + /// is as short as the shortest input sequence. + /// + /// Type of elements in first sequence. + /// Type of elements in second sequence. + /// Type of elements in third sequence. + /// Type of elements in fourth sequence. + /// The first sequence. + /// The second sequence. + /// The third sequence. + /// The fourth sequence. + /// + /// A sequence of tuples that contains elements of the four input sequences. + /// + /// + /// + /// The zipped variable, when iterated over, will yield + /// (1, "A", 'a', ), (2, "B", 'b', ) in turn. + /// + /// + /// + /// If the input sequences are of different lengths, the result sequence + /// is terminated as soon as the shortest input sequence is exhausted + /// and remainder elements from the longer sequences are never consumed. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(T1, T2, T3, T4)> ZipShortest( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth) + => MoreEnumerable.ZipShortest(first, second, third, fourth); + /// /// Returns a projection of tuples, where each tuple contains the N-th /// element from each of the argument sequences. The resulting sequence diff --git a/MoreLinq/Lag.cs b/MoreLinq/Lag.cs index 4b532a649..24c36b81e 100644 --- a/MoreLinq/Lag.cs +++ b/MoreLinq/Lag.cs @@ -113,5 +113,40 @@ public static IEnumerable Lag(this IEnumerable + /// Produces a sequence of tuple containing a pair of elements separated by a negative offset. + /// + /// + /// This operator evaluates in a deferred and streaming manner.
+ /// For elements prior to the lag offset, default(T) is used as the lagged value.
+ ///
+ /// The type of the elements of the source sequence + /// The sequence over which to evaluate lag + /// The offset (expressed as a positive number) by which to lag each value of the sequence + /// A sequence of element of the sequence with its lagged pairing + + public static IEnumerable<(TSource Item, TSource OffsetItem)> Lag(this IEnumerable source, int offset) + { + return Lag(source, offset, default, ValueTuple.Create); + } + + /// + /// Produces a sequence of tuple containing a pair of elements separated by a negative offset. + /// + /// + /// This operator evaluates in a deferred and streaming manner.
+ /// For elements prior to the lag offset, is used as the lagged value.
+ ///
+ /// The type of the elements of the source sequence + /// The sequence over which to evaluate lag + /// The offset (expressed as a positive number) by which to lag each value of the sequence + /// A default value supplied for the lagged value prior to the lag offset + /// A sequence of element of the sequence with its lagged pairing + + public static IEnumerable<(TSource Item, TSource OffsetItem)> Lag(this IEnumerable source, int offset, TSource defaultLagValue) + { + return Lag(source, offset, defaultLagValue, ValueTuple.Create); + } } } diff --git a/MoreLinq/Lead.cs b/MoreLinq/Lead.cs index 2a0b7cbb3..2668f4805 100644 --- a/MoreLinq/Lead.cs +++ b/MoreLinq/Lead.cs @@ -103,5 +103,40 @@ public static IEnumerable Lead(this IEnumerable + /// Produces a sequence of tuple containing a pair of elements separated by a positive offset. + ///
+ /// + /// This operator evaluates in a deferred and streaming manner.
+ /// For elements of the sequence that are less than items from the end, + /// default(T) is used as the lead value.
+ ///
+ /// The type of the elements in the source sequence + /// The sequence over which to evaluate Lead + /// The offset (expressed as a positive number) by which to lead each element of the sequence + /// The produced sequence of tuple + + public static IEnumerable<(TSource Item, TSource? OffsetItem)> Lead(this IEnumerable source, int offset) + { + return Lead(source, offset, ValueTuple.Create); + } + + /// + /// Produces a sequence of tuple containing a pair of elements separated by a positive offset. + /// + /// + /// This operator evaluates in a deferred and streaming manner.
+ ///
+ /// The type of the elements in the source sequence + /// The sequence over which to evaluate Lead + /// The offset (expressed as a positive number) by which to lead each element of the sequence + /// A default value supplied for the leading element when none is available + /// The produced sequence of tuple + + public static IEnumerable<(TSource Item, TSource OffsetItem)> Lead(this IEnumerable source, int offset, TSource defaultLeadValue) + { + return Lead(source, offset, defaultLeadValue, ValueTuple.Create); + } } } diff --git a/MoreLinq/Pairwise.cs b/MoreLinq/Pairwise.cs index 9e262e85d..aa8bbed02 100644 --- a/MoreLinq/Pairwise.cs +++ b/MoreLinq/Pairwise.cs @@ -22,6 +22,26 @@ namespace MoreLinq static partial class MoreEnumerable { + /// + /// Returns a sequence where each element in the source sequence is + /// paired with its predecessor, with the exception of the first + /// element which is only returned as the predecessor of the second + /// element. + /// + /// + /// The type of the elements of . + /// The source sequence. + /// + /// Returns the resulting sequence. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(TSource, TSource)> + Pairwise(this IEnumerable source) => + Pairwise(source, ValueTuple.Create); + /// /// Returns a sequence resulting from applying a function to each /// element in the source sequence and its diff --git a/MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt b/MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt index 8b26bf00b..152471471 100644 --- a/MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt +++ b/MoreLinq/PublicAPI/net6.0/PublicAPI.Unshipped.txt @@ -21,15 +21,53 @@ MoreLinq.Extensions.MaximaExtension MoreLinq.Extensions.MinimaExtension static MoreLinq.Extensions.BatchExtension.Batch(this System.Collections.Generic.IEnumerable! source, int size, System.Func! resultSelector) -> System.Collections.Generic.IEnumerable! static MoreLinq.Extensions.BatchExtension.Batch(this System.Collections.Generic.IEnumerable! source, int size) -> System.Collections.Generic.IEnumerable! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth, System.Collections.Generic.IEnumerable! seventh, System.Collections.Generic.IEnumerable! eighth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh, T8 Eighth)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth, System.Collections.Generic.IEnumerable! seventh) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second)>! +static MoreLinq.Extensions.CountDownExtension.CountDown(this System.Collections.Generic.IEnumerable! source, int count) -> System.Collections.Generic.IEnumerable<(T Item, int? CountDown)>! +static MoreLinq.Extensions.EquiZipExtension.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.Extensions.EquiZipExtension.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.Extensions.EquiZipExtension.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(T1, T2)>! +static MoreLinq.Extensions.LagExtension.Lag(this System.Collections.Generic.IEnumerable! source, int offset) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! +static MoreLinq.Extensions.LagExtension.Lag(this System.Collections.Generic.IEnumerable! source, int offset, TSource defaultLagValue) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! +static MoreLinq.Extensions.LeadExtension.Lead(this System.Collections.Generic.IEnumerable! source, int offset) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource? OffsetItem)>! +static MoreLinq.Extensions.LeadExtension.Lead(this System.Collections.Generic.IEnumerable! source, int offset, TSource defaultLeadValue) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! static MoreLinq.Extensions.MaximaExtension.Maxima(this System.Collections.Generic.IEnumerable! source, System.Func! selector) -> MoreLinq.IExtremaEnumerable! static MoreLinq.Extensions.MaximaExtension.Maxima(this System.Collections.Generic.IEnumerable! source, System.Func! selector, System.Collections.Generic.IComparer? comparer) -> MoreLinq.IExtremaEnumerable! static MoreLinq.Extensions.MinimaExtension.Minima(this System.Collections.Generic.IEnumerable! source, System.Func! selector) -> MoreLinq.IExtremaEnumerable! static MoreLinq.Extensions.MinimaExtension.Minima(this System.Collections.Generic.IEnumerable! source, System.Func! selector, System.Collections.Generic.IComparer? comparer) -> MoreLinq.IExtremaEnumerable! +static MoreLinq.Extensions.PairwiseExtension.Pairwise(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.IEnumerable<(TSource, TSource)>! +static MoreLinq.Extensions.TagFirstLastExtension.TagFirstLast(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.IEnumerable<(TSource Item, bool IsFirst, bool IsLast)>! +static MoreLinq.Extensions.ZipLongestExtension.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.Extensions.ZipLongestExtension.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.Extensions.ZipLongestExtension.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(TFirst, TSecond)>! +static MoreLinq.Extensions.ZipShortestExtension.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.Extensions.ZipShortestExtension.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.Extensions.ZipShortestExtension.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(TFirst, TSecond)>! static MoreLinq.MoreEnumerable.Append(System.Collections.Generic.IEnumerable! head, T tail) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.Batch(this System.Collections.Generic.IEnumerable! source, int size, System.Func! resultSelector) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.Batch(this System.Collections.Generic.IEnumerable! source, int size) -> System.Collections.Generic.IEnumerable! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth, System.Collections.Generic.IEnumerable! seventh, System.Collections.Generic.IEnumerable! eighth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh, T8 Eighth)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth, System.Collections.Generic.IEnumerable! seventh) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second)>! +static MoreLinq.MoreEnumerable.CountDown(this System.Collections.Generic.IEnumerable! source, int count) -> System.Collections.Generic.IEnumerable<(T Item, int? CountDown)>! static MoreLinq.MoreEnumerable.DistinctBy(System.Collections.Generic.IEnumerable! source, System.Func! keySelector) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.DistinctBy(System.Collections.Generic.IEnumerable! source, System.Func! keySelector, System.Collections.Generic.IEqualityComparer? comparer) -> System.Collections.Generic.IEnumerable! +static MoreLinq.MoreEnumerable.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.MoreEnumerable.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.MoreEnumerable.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(T1, T2)>! +static MoreLinq.MoreEnumerable.Lag(this System.Collections.Generic.IEnumerable! source, int offset) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! +static MoreLinq.MoreEnumerable.Lag(this System.Collections.Generic.IEnumerable! source, int offset, TSource defaultLagValue) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! +static MoreLinq.MoreEnumerable.Lead(this System.Collections.Generic.IEnumerable! source, int offset) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource? OffsetItem)>! +static MoreLinq.MoreEnumerable.Lead(this System.Collections.Generic.IEnumerable! source, int offset, TSource defaultLeadValue) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! static MoreLinq.MoreEnumerable.MaxBy(System.Collections.Generic.IEnumerable! source, System.Func! selector) -> MoreLinq.IExtremaEnumerable! static MoreLinq.MoreEnumerable.MaxBy(System.Collections.Generic.IEnumerable! source, System.Func! selector, System.Collections.Generic.IComparer? comparer) -> MoreLinq.IExtremaEnumerable! static MoreLinq.MoreEnumerable.Maxima(this System.Collections.Generic.IEnumerable! source, System.Func! selector) -> MoreLinq.IExtremaEnumerable! @@ -38,8 +76,16 @@ static MoreLinq.MoreEnumerable.MinBy(System.Collections.Generic.I static MoreLinq.MoreEnumerable.MinBy(System.Collections.Generic.IEnumerable! source, System.Func! selector, System.Collections.Generic.IComparer? comparer) -> MoreLinq.IExtremaEnumerable! static MoreLinq.MoreEnumerable.Minima(this System.Collections.Generic.IEnumerable! source, System.Func! selector) -> MoreLinq.IExtremaEnumerable! static MoreLinq.MoreEnumerable.Minima(this System.Collections.Generic.IEnumerable! source, System.Func! selector, System.Collections.Generic.IComparer? comparer) -> MoreLinq.IExtremaEnumerable! +static MoreLinq.MoreEnumerable.Pairwise(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.IEnumerable<(TSource, TSource)>! static MoreLinq.MoreEnumerable.Prepend(System.Collections.Generic.IEnumerable! source, TSource value) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.SkipLast(System.Collections.Generic.IEnumerable! source, int count) -> System.Collections.Generic.IEnumerable! +static MoreLinq.MoreEnumerable.TagFirstLast(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.IEnumerable<(TSource Item, bool IsFirst, bool IsLast)>! static MoreLinq.MoreEnumerable.TakeLast(System.Collections.Generic.IEnumerable! source, int count) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.ToHashSet(System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.HashSet! static MoreLinq.MoreEnumerable.ToHashSet(System.Collections.Generic.IEnumerable! source, System.Collections.Generic.IEqualityComparer? comparer) -> System.Collections.Generic.HashSet! +static MoreLinq.MoreEnumerable.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.MoreEnumerable.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.MoreEnumerable.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(TFirst, TSecond)>! +static MoreLinq.MoreEnumerable.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.MoreEnumerable.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.MoreEnumerable.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(TFirst, TSecond)>! diff --git a/MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt b/MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt index baeef302c..b8ca0b3d2 100644 --- a/MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt +++ b/MoreLinq/PublicAPI/netstandard2.0/PublicAPI.Unshipped.txt @@ -11,15 +11,61 @@ MoreLinq.Extensions.MaximaExtension MoreLinq.Extensions.MinimaExtension static MoreLinq.Extensions.BatchExtension.Batch(this System.Collections.Generic.IEnumerable! source, int size, System.Func! resultSelector) -> System.Collections.Generic.IEnumerable! static MoreLinq.Extensions.BatchExtension.Batch(this System.Collections.Generic.IEnumerable! source, int size) -> System.Collections.Generic.IEnumerable! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth, System.Collections.Generic.IEnumerable! seventh, System.Collections.Generic.IEnumerable! eighth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh, T8 Eighth)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth, System.Collections.Generic.IEnumerable! seventh) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second)>! +static MoreLinq.Extensions.CountDownExtension.CountDown(this System.Collections.Generic.IEnumerable! source, int count) -> System.Collections.Generic.IEnumerable<(T Item, int? CountDown)>! +static MoreLinq.Extensions.EquiZipExtension.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.Extensions.EquiZipExtension.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.Extensions.EquiZipExtension.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(T1, T2)>! +static MoreLinq.Extensions.LagExtension.Lag(this System.Collections.Generic.IEnumerable! source, int offset) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! +static MoreLinq.Extensions.LagExtension.Lag(this System.Collections.Generic.IEnumerable! source, int offset, TSource defaultLagValue) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! +static MoreLinq.Extensions.LeadExtension.Lead(this System.Collections.Generic.IEnumerable! source, int offset) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource? OffsetItem)>! +static MoreLinq.Extensions.LeadExtension.Lead(this System.Collections.Generic.IEnumerable! source, int offset, TSource defaultLeadValue) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! static MoreLinq.Extensions.MaximaExtension.Maxima(this System.Collections.Generic.IEnumerable! source, System.Func! selector) -> MoreLinq.IExtremaEnumerable! static MoreLinq.Extensions.MaximaExtension.Maxima(this System.Collections.Generic.IEnumerable! source, System.Func! selector, System.Collections.Generic.IComparer? comparer) -> MoreLinq.IExtremaEnumerable! static MoreLinq.Extensions.MinimaExtension.Minima(this System.Collections.Generic.IEnumerable! source, System.Func! selector) -> MoreLinq.IExtremaEnumerable! static MoreLinq.Extensions.MinimaExtension.Minima(this System.Collections.Generic.IEnumerable! source, System.Func! selector, System.Collections.Generic.IComparer? comparer) -> MoreLinq.IExtremaEnumerable! +static MoreLinq.Extensions.PairwiseExtension.Pairwise(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.IEnumerable<(TSource, TSource)>! +static MoreLinq.Extensions.TagFirstLastExtension.TagFirstLast(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.IEnumerable<(TSource Item, bool IsFirst, bool IsLast)>! +static MoreLinq.Extensions.ZipLongestExtension.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.Extensions.ZipLongestExtension.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.Extensions.ZipLongestExtension.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(TFirst, TSecond)>! +static MoreLinq.Extensions.ZipShortestExtension.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.Extensions.ZipShortestExtension.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.Extensions.ZipShortestExtension.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(TFirst, TSecond)>! static MoreLinq.MoreEnumerable.Append(System.Collections.Generic.IEnumerable! head, T tail) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.Batch(this System.Collections.Generic.IEnumerable! source, int size, System.Func! resultSelector) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.Batch(this System.Collections.Generic.IEnumerable! source, int size) -> System.Collections.Generic.IEnumerable! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth, System.Collections.Generic.IEnumerable! seventh, System.Collections.Generic.IEnumerable! eighth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh, T8 Eighth)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth, System.Collections.Generic.IEnumerable! seventh) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second)>! +static MoreLinq.MoreEnumerable.CountDown(this System.Collections.Generic.IEnumerable! source, int count) -> System.Collections.Generic.IEnumerable<(T Item, int? CountDown)>! +static MoreLinq.MoreEnumerable.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.MoreEnumerable.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.MoreEnumerable.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(T1, T2)>! +static MoreLinq.MoreEnumerable.Lag(this System.Collections.Generic.IEnumerable! source, int offset) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! +static MoreLinq.MoreEnumerable.Lag(this System.Collections.Generic.IEnumerable! source, int offset, TSource defaultLagValue) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! +static MoreLinq.MoreEnumerable.Lead(this System.Collections.Generic.IEnumerable! source, int offset) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource? OffsetItem)>! +static MoreLinq.MoreEnumerable.Lead(this System.Collections.Generic.IEnumerable! source, int offset, TSource defaultLeadValue) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! static MoreLinq.MoreEnumerable.Maxima(this System.Collections.Generic.IEnumerable! source, System.Func! selector) -> MoreLinq.IExtremaEnumerable! static MoreLinq.MoreEnumerable.Maxima(this System.Collections.Generic.IEnumerable! source, System.Func! selector, System.Collections.Generic.IComparer? comparer) -> MoreLinq.IExtremaEnumerable! static MoreLinq.MoreEnumerable.Minima(this System.Collections.Generic.IEnumerable! source, System.Func! selector) -> MoreLinq.IExtremaEnumerable! static MoreLinq.MoreEnumerable.Minima(this System.Collections.Generic.IEnumerable! source, System.Func! selector, System.Collections.Generic.IComparer? comparer) -> MoreLinq.IExtremaEnumerable! +static MoreLinq.MoreEnumerable.Pairwise(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.IEnumerable<(TSource, TSource)>! static MoreLinq.MoreEnumerable.Prepend(System.Collections.Generic.IEnumerable! source, TSource value) -> System.Collections.Generic.IEnumerable! +static MoreLinq.MoreEnumerable.TagFirstLast(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.IEnumerable<(TSource Item, bool IsFirst, bool IsLast)>! +static MoreLinq.MoreEnumerable.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.MoreEnumerable.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.MoreEnumerable.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(TFirst, TSecond)>! +static MoreLinq.MoreEnumerable.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.MoreEnumerable.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.MoreEnumerable.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(TFirst, TSecond)>! diff --git a/MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt b/MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt index 0a76e35e0..7d42906b5 100644 --- a/MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt +++ b/MoreLinq/PublicAPI/netstandard2.1/PublicAPI.Unshipped.txt @@ -15,19 +15,65 @@ MoreLinq.Extensions.MaximaExtension MoreLinq.Extensions.MinimaExtension static MoreLinq.Extensions.BatchExtension.Batch(this System.Collections.Generic.IEnumerable! source, int size, System.Func! resultSelector) -> System.Collections.Generic.IEnumerable! static MoreLinq.Extensions.BatchExtension.Batch(this System.Collections.Generic.IEnumerable! source, int size) -> System.Collections.Generic.IEnumerable! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth, System.Collections.Generic.IEnumerable! seventh, System.Collections.Generic.IEnumerable! eighth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh, T8 Eighth)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth, System.Collections.Generic.IEnumerable! seventh) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third)>! +static MoreLinq.Extensions.CartesianExtension.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second)>! +static MoreLinq.Extensions.CountDownExtension.CountDown(this System.Collections.Generic.IEnumerable! source, int count) -> System.Collections.Generic.IEnumerable<(T Item, int? CountDown)>! +static MoreLinq.Extensions.EquiZipExtension.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.Extensions.EquiZipExtension.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.Extensions.EquiZipExtension.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(T1, T2)>! +static MoreLinq.Extensions.LagExtension.Lag(this System.Collections.Generic.IEnumerable! source, int offset) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! +static MoreLinq.Extensions.LagExtension.Lag(this System.Collections.Generic.IEnumerable! source, int offset, TSource defaultLagValue) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! +static MoreLinq.Extensions.LeadExtension.Lead(this System.Collections.Generic.IEnumerable! source, int offset) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource? OffsetItem)>! +static MoreLinq.Extensions.LeadExtension.Lead(this System.Collections.Generic.IEnumerable! source, int offset, TSource defaultLeadValue) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! static MoreLinq.Extensions.MaximaExtension.Maxima(this System.Collections.Generic.IEnumerable! source, System.Func! selector) -> MoreLinq.IExtremaEnumerable! static MoreLinq.Extensions.MaximaExtension.Maxima(this System.Collections.Generic.IEnumerable! source, System.Func! selector, System.Collections.Generic.IComparer? comparer) -> MoreLinq.IExtremaEnumerable! static MoreLinq.Extensions.MinimaExtension.Minima(this System.Collections.Generic.IEnumerable! source, System.Func! selector) -> MoreLinq.IExtremaEnumerable! static MoreLinq.Extensions.MinimaExtension.Minima(this System.Collections.Generic.IEnumerable! source, System.Func! selector, System.Collections.Generic.IComparer? comparer) -> MoreLinq.IExtremaEnumerable! +static MoreLinq.Extensions.PairwiseExtension.Pairwise(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.IEnumerable<(TSource, TSource)>! +static MoreLinq.Extensions.TagFirstLastExtension.TagFirstLast(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.IEnumerable<(TSource Item, bool IsFirst, bool IsLast)>! +static MoreLinq.Extensions.ZipLongestExtension.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.Extensions.ZipLongestExtension.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.Extensions.ZipLongestExtension.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(TFirst, TSecond)>! +static MoreLinq.Extensions.ZipShortestExtension.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.Extensions.ZipShortestExtension.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.Extensions.ZipShortestExtension.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(TFirst, TSecond)>! static MoreLinq.MoreEnumerable.Append(System.Collections.Generic.IEnumerable! head, T tail) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.Batch(this System.Collections.Generic.IEnumerable! source, int size, System.Func! resultSelector) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.Batch(this System.Collections.Generic.IEnumerable! source, int size) -> System.Collections.Generic.IEnumerable! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth, System.Collections.Generic.IEnumerable! seventh, System.Collections.Generic.IEnumerable! eighth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh, T8 Eighth)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth, System.Collections.Generic.IEnumerable! seventh) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth, T7 Seventh)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth, System.Collections.Generic.IEnumerable! sixth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth, T6 Sixth)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth, System.Collections.Generic.IEnumerable! fifth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth, T5 Fifth)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third, T4 Fourth)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second, T3 Third)>! +static MoreLinq.MoreEnumerable.Cartesian(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(T1 First, T2 Second)>! +static MoreLinq.MoreEnumerable.CountDown(this System.Collections.Generic.IEnumerable! source, int count) -> System.Collections.Generic.IEnumerable<(T Item, int? CountDown)>! +static MoreLinq.MoreEnumerable.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.MoreEnumerable.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.MoreEnumerable.EquiZip(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(T1, T2)>! +static MoreLinq.MoreEnumerable.Lag(this System.Collections.Generic.IEnumerable! source, int offset) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! +static MoreLinq.MoreEnumerable.Lag(this System.Collections.Generic.IEnumerable! source, int offset, TSource defaultLagValue) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! +static MoreLinq.MoreEnumerable.Lead(this System.Collections.Generic.IEnumerable! source, int offset) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource? OffsetItem)>! +static MoreLinq.MoreEnumerable.Lead(this System.Collections.Generic.IEnumerable! source, int offset, TSource defaultLeadValue) -> System.Collections.Generic.IEnumerable<(TSource Item, TSource OffsetItem)>! static MoreLinq.MoreEnumerable.Maxima(this System.Collections.Generic.IEnumerable! source, System.Func! selector) -> MoreLinq.IExtremaEnumerable! static MoreLinq.MoreEnumerable.Maxima(this System.Collections.Generic.IEnumerable! source, System.Func! selector, System.Collections.Generic.IComparer? comparer) -> MoreLinq.IExtremaEnumerable! static MoreLinq.MoreEnumerable.Minima(this System.Collections.Generic.IEnumerable! source, System.Func! selector) -> MoreLinq.IExtremaEnumerable! static MoreLinq.MoreEnumerable.Minima(this System.Collections.Generic.IEnumerable! source, System.Func! selector, System.Collections.Generic.IComparer? comparer) -> MoreLinq.IExtremaEnumerable! +static MoreLinq.MoreEnumerable.Pairwise(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.IEnumerable<(TSource, TSource)>! static MoreLinq.MoreEnumerable.Prepend(System.Collections.Generic.IEnumerable! source, TSource value) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.SkipLast(System.Collections.Generic.IEnumerable! source, int count) -> System.Collections.Generic.IEnumerable! +static MoreLinq.MoreEnumerable.TagFirstLast(this System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.IEnumerable<(TSource Item, bool IsFirst, bool IsLast)>! static MoreLinq.MoreEnumerable.TakeLast(System.Collections.Generic.IEnumerable! source, int count) -> System.Collections.Generic.IEnumerable! static MoreLinq.MoreEnumerable.ToHashSet(System.Collections.Generic.IEnumerable! source) -> System.Collections.Generic.HashSet! static MoreLinq.MoreEnumerable.ToHashSet(System.Collections.Generic.IEnumerable! source, System.Collections.Generic.IEqualityComparer? comparer) -> System.Collections.Generic.HashSet! +static MoreLinq.MoreEnumerable.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.MoreEnumerable.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.MoreEnumerable.ZipLongest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(TFirst, TSecond)>! +static MoreLinq.MoreEnumerable.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third, System.Collections.Generic.IEnumerable! fourth) -> System.Collections.Generic.IEnumerable<(T1, T2, T3, T4)>! +static MoreLinq.MoreEnumerable.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second, System.Collections.Generic.IEnumerable! third) -> System.Collections.Generic.IEnumerable<(T1, T2, T3)>! +static MoreLinq.MoreEnumerable.ZipShortest(this System.Collections.Generic.IEnumerable! first, System.Collections.Generic.IEnumerable! second) -> System.Collections.Generic.IEnumerable<(TFirst, TSecond)>! diff --git a/MoreLinq/TagFirstLast.cs b/MoreLinq/TagFirstLast.cs index 61d90f6e7..3e38f9477 100644 --- a/MoreLinq/TagFirstLast.cs +++ b/MoreLinq/TagFirstLast.cs @@ -78,5 +78,33 @@ public static IEnumerable TagFirstLast(this IEnumerab } } } + + /// + /// Returns a sequence of tuples, where the N-th tuple contains the N-th + /// element of the source sequence and two booleans indicating whether the + /// element is the first and/or last. + /// + /// The type of the elements of . + /// The source sequence. + /// + /// Returns the resulting sequence. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + /// + /// + /// The result variable, when iterated over, will yield + /// (123, True, False), (456, False, False) and + /// (789, False, True) in turn. + /// + + public static IEnumerable<(TSource Item, bool IsFirst, bool IsLast)> TagFirstLast(this IEnumerable source) + { + return TagFirstLast(source, ValueTuple.Create); + } } } diff --git a/MoreLinq/ZipLongest.cs b/MoreLinq/ZipLongest.cs index 38e5fdefc..d3d0485e6 100644 --- a/MoreLinq/ZipLongest.cs +++ b/MoreLinq/ZipLongest.cs @@ -179,5 +179,120 @@ public static IEnumerable ZipLongest( return ZipImpl(first, second, third, fourth, resultSelector, 3); } + + /// + /// Returns a sequence of tuples, where each tuple contains the N-th + /// element from each of the argument sequences. The resulting sequence + /// will always be as long as the longest of input sequences where the + /// default value of each of the shorter sequence element types is used + /// for padding. + /// + /// Type of elements in first sequence. + /// Type of elements in second sequence. + /// The first sequence. + /// The second sequence. + /// + /// A sequence of tuples that contains elements of the two input sequences. + /// + /// + /// + /// The zipped variable, when iterated over, will yield the tuples : (1, A), + /// (2, B), (3, C), (0, D) in turn. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(TFirst, TSecond)> ZipLongest( + this IEnumerable first, + IEnumerable second) + { + return first.ZipLongest(second, ValueTuple.Create); + } + + /// + /// Returns a sequence of tuples, where each tuple contains the N-th + /// element from each of the argument sequences. The resulting sequence + /// will always be as long as the longest of input sequences where the + /// default value of each of the shorter sequence element types is used + /// for padding. + /// + /// Type of elements in first sequence. + /// Type of elements in second sequence. + /// Type of elements in third sequence. + /// The first sequence. + /// The second sequence. + /// The third sequence. + /// + /// A sequence of tuples that contains elements of the three input sequences. + /// + /// + /// + /// The zipped variable, when iterated over, will yield (1, "A", 'a'), + /// (2, "B", 'b'), (3, "C", 'c'), (0, "D", 'd'), (0, , 'e') in turn. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(T1, T2, T3)> ZipLongest( + this IEnumerable first, + IEnumerable second, + IEnumerable third) + { + return first.ZipLongest(second, third, ValueTuple.Create); + } + + /// + /// Returns a sequence of tuples, where each tuple contains the N-th + /// element from each of the argument sequences. The resulting sequence + /// will always be as long as the longest of input sequences where the + /// default value of each of the shorter sequence element types is used + /// for padding. + /// + /// Type of elements in first sequence + /// Type of elements in second sequence + /// Type of elements in third sequence + /// Type of elements in fourth sequence + /// The first sequence. + /// The second sequence. + /// The third sequence. + /// The fourth sequence. + /// + /// A sequence of tuples that contains elements of the four input sequences. + /// + /// + /// + /// The zipped variable, when iterated over, will yield (1, "A", 'a', ), + /// (2, "B", 'b', ), (3, "C", 'c', ), (0, "D", 'd', ), + /// (0, , 'e', ), (0, , '\0', ) in turn. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(T1, T2, T3, T4)> ZipLongest( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth) + { + return first.ZipLongest(second, third, fourth, ValueTuple.Create); + } } } diff --git a/MoreLinq/ZipShortest.cs b/MoreLinq/ZipShortest.cs index fbb28d046..360104832 100644 --- a/MoreLinq/ZipShortest.cs +++ b/MoreLinq/ZipShortest.cs @@ -188,6 +188,132 @@ public static IEnumerable ZipShortest( return ZipImpl(first, second, third, fourth, resultSelector); } + /// + /// Returns a sequence of tuples, where each tuple contains the N-th + /// element from each of the argument sequences. The resulting sequence + /// is as short as the shortest input sequence. + /// + /// Type of elements in first sequence. + /// Type of elements in second sequence. + /// The first sequence. + /// The second sequence. + /// + /// A sequence of tuples that contains elements of the two input sequences. + /// + /// + /// + /// The zipped variable, when iterated over, will yield + /// (1, "A"), (2, "B"), (3, "C") in turn. + /// + /// + /// + /// If the input sequences are of different lengths, the result sequence + /// is terminated as soon as the shortest input sequence is exhausted + /// and remainder elements from the longer sequences are never consumed. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(TFirst, TSecond)> ZipShortest( + this IEnumerable first, + IEnumerable second) + { + return first.ZipShortest(second, ValueTuple.Create); + } + + /// + /// Returns a sequence of tuples, where each tuple contains the N-th + /// element from each of the argument sequences. The resulting sequence + /// is as short as the shortest input sequence. + /// + /// Type of elements in first sequence. + /// Type of elements in second sequence. + /// Type of elements in third sequence. + /// First sequence + /// Second sequence + /// Third sequence + /// + /// A sequence of tuples that contains elements of the three input sequences. + /// + /// + /// + /// The zipped variable, when iterated over, will yield + /// (1, "A", 'a'), (2, "B", 'b'), (3, "C", 'c') in turn. + /// + /// + /// + /// If the input sequences are of different lengths, the result sequence + /// is terminated as soon as the shortest input sequence is exhausted + /// and remainder elements from the longer sequences are never consumed. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(T1, T2, T3)> ZipShortest( + this IEnumerable first, + IEnumerable second, + IEnumerable third) + { + return first.ZipShortest(second, third, ValueTuple.Create); + } + + /// + /// Returns a sequence of tuples, where each tuple contains the N-th + /// element from each of the argument sequences. The resulting sequence + /// is as short as the shortest input sequence. + /// + /// Type of elements in first sequence. + /// Type of elements in second sequence. + /// Type of elements in third sequence. + /// Type of elements in fourth sequence. + /// The first sequence. + /// The second sequence. + /// The third sequence. + /// The fourth sequence. + /// + /// A sequence of tuples that contains elements of the four input sequences. + /// + /// + /// + /// The zipped variable, when iterated over, will yield + /// (1, "A", 'a', ), (2, "B", 'b', ) in turn. + /// + /// + /// + /// If the input sequences are of different lengths, the result sequence + /// is terminated as soon as the shortest input sequence is exhausted + /// and remainder elements from the longer sequences are never consumed. + /// + /// + /// This operator uses deferred execution and streams its results. + /// + + public static IEnumerable<(T1, T2, T3, T4)> ZipShortest( + this IEnumerable first, + IEnumerable second, + IEnumerable third, + IEnumerable fourth) + { + return first.ZipShortest(second, third, fourth, ValueTuple.Create); + } + static IEnumerable ZipImpl( IEnumerable s1, IEnumerable s2, diff --git a/README.md b/README.md index ac9da48de..83371caee 100644 --- a/README.md +++ b/README.md @@ -150,7 +150,7 @@ Returns the Cartesian product of two or more sequences by combining each element from the sequences and applying a user-defined projection to the set. -This method has 7 overloads. +This method has 14 overloads. ### Choose @@ -198,6 +198,8 @@ Provides a countdown counter for a given count of elements at the tail of the sequence where zero always represents the last element, one represents the second-last element, two represents the third-last element and so on. +This method has 2 overloads. + ### DistinctBy Returns all distinct elements of the given source, where "distinctness" is @@ -219,7 +221,7 @@ 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. -This method has 3 overloads. +This method has 6 overloads. ### Exactly @@ -346,14 +348,14 @@ skipping sequences as they are consumed. Produces a projection of a sequence by evaluating pairs of elements separated by a negative offset. -This method has 2 overloads. +This method has 4 overloads. ### Lead Produces a projection of a sequence by evaluating pairs of elements separated by a positive offset. -This method has 2 overloads. +This method has 4 overloads. ### LeftJoin @@ -433,6 +435,8 @@ Returns a sequence resulting from applying a function to each element in the source sequence and its predecessor, with the exception of the first element which is only returned as the predecessor of the second element +This method has 2 overloads. + ### PartialSort Combines `OrderBy` (where element is key) and `Take` in a single operation. @@ -612,6 +616,8 @@ Returns a sequence resulting from applying a function to each element in the source sequence with additional parameters indicating whether the element is the first and/or last of the sequence +This method has 2 overloads. + ### TakeEvery Returns every N-th element of a source sequence @@ -729,7 +735,7 @@ will always be as long as the longest of input sequences where the default value of each of the shorter sequence element types is used for padding. -This method has 3 overloads. +This method has 6 overloads. ### ZipShortest @@ -737,7 +743,7 @@ Returns a projection of tuples, where each tuple contains the N-th element from each of the argument sequences. The resulting sequence is as short as the shortest input sequence. -This method has 3 overloads. +This method has 6 overloads. ## Experimental Operators