public static ValueEnumerableExtensions.SelectManyEnumerable <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource, TSubEnumerable, TSubEnumerator, TResult, TSelector> SelectMany <TSource, TSubEnumerable, TSubEnumerator, TResult, TSelector>( this ImmutableStack <TSource> source, TSelector selector = default) where TSubEnumerable : IValueEnumerable <TResult, TSubEnumerator> where TSubEnumerator : struct, IEnumerator <TResult> where TSelector : struct, IFunction <TSource, TSubEnumerable> => ValueEnumerableExtensions.SelectMany <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource, TSubEnumerable, TSubEnumerator, TResult, TSelector>(new ValueWrapper <TSource>(source), selector);
static Option <TResult> ElementAtAt <TEnumerable, TEnumerator, TSource, TResult, TSelector>(this TEnumerable source, int index, TSelector selector) where TEnumerable : IValueReadOnlyCollection <TSource, TEnumerator> where TEnumerator : struct, IEnumerator <TSource> where TSelector : struct, IFunction <TSource, int, TResult> => index < source.Count ? ValueEnumerableExtensions.ElementAtAt <TEnumerable, TEnumerator, TSource, TResult, TSelector>(source, index, selector) : Option.None;
public static ValueEnumerableExtensions.SelectManyEnumerable <ValueWrapper <TKey, TValue>, Dictionary <TKey, TValue> .Enumerator, KeyValuePair <TKey, TValue>, TSubEnumerable, TSubEnumerator, TResult> SelectMany <TKey, TValue, TSubEnumerable, TSubEnumerator, TResult>( this Dictionary <TKey, TValue> source, Selector <KeyValuePair <TKey, TValue>, TSubEnumerable> selector) where TSubEnumerable : IValueEnumerable <TResult, TSubEnumerator> where TSubEnumerator : struct, IEnumerator <TResult> where TKey : notnull => ValueEnumerableExtensions.SelectMany <ValueWrapper <TKey, TValue>, Dictionary <TKey, TValue> .Enumerator, KeyValuePair <TKey, TValue>, TSubEnumerable, TSubEnumerator, TResult>(new ValueWrapper <TKey, TValue>(source), selector);
public static Dictionary <TKey, TSource> ToDictionary <TEnumerable, TEnumerator, TSource, TKey, TKeySelector>(this TEnumerable source, TKeySelector keySelector, IEqualityComparer <TKey>?comparer = default) where TEnumerable : IValueReadOnlyCollection <TSource, TEnumerator> where TEnumerator : struct, IEnumerator <TSource> where TKey : notnull where TKeySelector : struct, IFunction <TSource, TKey> => source.Count is 0 // ReSharper disable once HeapView.ObjectAllocation.Evident ? new Dictionary <TKey, TSource>() : ValueEnumerableExtensions.ToDictionary <TEnumerable, TEnumerator, TSource, TKey, TKeySelector>(source, keySelector, comparer);
static Dictionary <TKey, TElement> ToDictionaryAt <TEnumerable, TEnumerator, TSource, TKey, TElement, TKeySelector, TElementSelector, TPredicate>(this TEnumerable source, TKeySelector keySelector, TElementSelector elementSelector, IEqualityComparer <TKey>?comparer, TPredicate predicate) where TEnumerable : IValueReadOnlyCollection <TSource, TEnumerator> where TEnumerator : struct, IEnumerator <TSource> where TKey : notnull where TKeySelector : struct, IFunction <TSource, TKey> where TElementSelector : struct, IFunction <TSource, TElement> where TPredicate : struct, IFunction <TSource, int, bool> => source.Count is 0 // ReSharper disable once HeapView.ObjectAllocation.Evident ? new Dictionary <TKey, TElement>() : ValueEnumerableExtensions.ToDictionaryAt <TEnumerable, TEnumerator, TSource, TKey, TElement, TKeySelector, TElementSelector, TPredicate>(source, keySelector, elementSelector, comparer, predicate);
public static bool Any <TSource>(this ImmutableStack <TSource> source) => ValueEnumerableExtensions.Any <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source));
public static ValueEnumerableExtensions.TakeEnumerable <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource> Take <TSource>(this ImmutableStack <TSource> source, int count) => ValueEnumerableExtensions.Take <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source), count);
public static ValueEnumerableExtensions.DistinctEnumerable <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource> Distinct <TSource>(this ImmutableStack <TSource> source, IEqualityComparer <TSource>?comparer = default) => ValueEnumerableExtensions.Distinct <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source), comparer);
public static ValueEnumerableExtensions.WhereAtEnumerable <ValueWrapper <TSource>, ImmutableHashSet <TSource> .Enumerator, TSource> Where <TSource>( this ImmutableHashSet <TSource> source, PredicateAt <TSource> predicate) => ValueEnumerableExtensions.Where <ValueWrapper <TSource>, ImmutableHashSet <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source), predicate);
public static ValueEnumerableExtensions.DistinctEnumerable <ValueWrapper <TKey, TValue>, SortedDictionary <TKey, TValue> .KeyCollection.Enumerator, TKey> Distinct <TKey, TValue>(this SortedDictionary <TKey, TValue> .KeyCollection source, IEqualityComparer <TKey>?comparer = default) => ValueEnumerableExtensions.Distinct <ValueWrapper <TKey, TValue>, SortedDictionary <TKey, TValue> .KeyCollection.Enumerator, TKey>(new ValueWrapper <TKey, TValue>(source), comparer);
public static ValueEnumerableExtensions.SelectManyEnumerable <ValueWrapper <TKey, TValue>, SortedDictionary <TKey, TValue> .KeyCollection.Enumerator, TKey, TSubEnumerable, TSubEnumerator, TResult> SelectMany <TKey, TValue, TSubEnumerable, TSubEnumerator, TResult>( this SortedDictionary <TKey, TValue> .KeyCollection source, Selector <TKey, TSubEnumerable> selector) where TSubEnumerable : IValueEnumerable <TResult, TSubEnumerator> where TSubEnumerator : struct, IEnumerator <TResult> => ValueEnumerableExtensions.SelectMany <ValueWrapper <TKey, TValue>, SortedDictionary <TKey, TValue> .KeyCollection.Enumerator, TKey, TSubEnumerable, TSubEnumerator, TResult>(new ValueWrapper <TKey, TValue>(source), selector);
public static bool Contains <TSource>(this ImmutableStack <TSource> source, TSource value, IEqualityComparer <TSource>?comparer = default) => ValueEnumerableExtensions.Contains <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source), value, comparer);
public static ValueEnumerableExtensions.WhereAtEnumerable <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource, FunctionWrapper <TSource, int, bool> > Where <TSource>( this ImmutableStack <TSource> source, Func <TSource, int, bool> predicate) => ValueEnumerableExtensions.Where <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source), predicate);
public static ValueEnumerableExtensions.WhereEnumerable <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource, TPredicate> Where <TSource, TPredicate>( this ImmutableStack <TSource> source, TPredicate predicate) where TPredicate : struct, IFunction <TSource, bool> => ValueEnumerableExtensions.Where <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource, TPredicate>(new ValueWrapper <TSource>(source), predicate);
public static ValueEnumerableExtensions.SelectAtEnumerable <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource, TResult> Select <TSource, TResult>( this ImmutableQueue <TSource> source, NullableSelectorAt <TSource, TResult> selector) => ValueEnumerableExtensions.Select <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource, TResult>(new ValueWrapper <TSource>(source), selector);
public static ValueEnumerableExtensions.WhereAtEnumerable <ValueWrapper <TSource>, ImmutableHashSet <TSource> .Enumerator, TSource, TPredicate> WhereAt <TSource, TPredicate>( this ImmutableHashSet <TSource> source, TPredicate predicate = default) where TPredicate : struct, IFunction <TSource, int, bool> => ValueEnumerableExtensions.WhereAt <ValueWrapper <TSource>, ImmutableHashSet <TSource> .Enumerator, TSource, TPredicate>(new ValueWrapper <TSource>(source), predicate);
public static ValueEnumerableExtensions.SelectManyEnumerable <ValueWrapper <TSource>, ImmutableHashSet <TSource> .Enumerator, TSource, TSubEnumerable, TSubEnumerator, TResult, FunctionWrapper <TSource, TSubEnumerable> > SelectMany <TSource, TSubEnumerable, TSubEnumerator, TResult>( this ImmutableHashSet <TSource> source, Func <TSource, TSubEnumerable> selector) where TSubEnumerable : IValueEnumerable <TResult, TSubEnumerator> where TSubEnumerator : struct, IEnumerator <TResult> => ValueEnumerableExtensions.SelectMany <ValueWrapper <TSource>, ImmutableHashSet <TSource> .Enumerator, TSource, TSubEnumerable, TSubEnumerator, TResult>(new ValueWrapper <TSource>(source), selector);
public static ValueEnumerableExtensions.WhereEnumerable <ValueWrapper <TKey, TValue>, SortedDictionary <TKey, TValue> .ValueCollection.Enumerator, TValue> Where <TKey, TValue>( this SortedDictionary <TKey, TValue> .ValueCollection source, Predicate <TValue> predicate) where TKey : notnull => ValueEnumerableExtensions.Where <ValueWrapper <TKey, TValue>, SortedDictionary <TKey, TValue> .ValueCollection.Enumerator, TValue>(new ValueWrapper <TKey, TValue>(source), predicate);
public static ValueEnumerableExtensions.DistinctEnumerable <ValueWrapper <TSource>, ImmutableHashSet <TSource> .Enumerator, TSource> Distinct <TSource>(this ImmutableHashSet <TSource> source, IEqualityComparer <TSource>?comparer = null) => ValueEnumerableExtensions.Distinct <ValueWrapper <TSource>, ImmutableHashSet <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source), comparer);
public static bool Any <TSource>(this ImmutableStack <TSource> source, Func <TSource, int, bool> predicate) => ValueEnumerableExtensions.Any <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source), predicate);
public static bool AnyAt <TSource, TPredicate>(this ImmutableStack <TSource> source, TPredicate predicate = default) where TPredicate : struct, IFunction <TSource, int, bool> => ValueEnumerableExtensions.AnyAt <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource, TPredicate>(new ValueWrapper <TSource>(source), predicate);
public static int Count <TSource>(this ImmutableStack <TSource> source) => ValueEnumerableExtensions.Count <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source));
public static ValueEnumerableExtensions.SelectAtEnumerable <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource, TResult, FunctionWrapper <TSource, int, TResult> > Select <TSource, TResult>( this ImmutableStack <TSource> source, Func <TSource, int, TResult> selector) => ValueEnumerableExtensions.Select <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource, TResult>(new ValueWrapper <TSource>(source), selector);
public static ValueEnumerableExtensions.WhereAtEnumerable <ValueWrapper <TKey, TValue>, Dictionary <TKey, TValue> .Enumerator, KeyValuePair <TKey, TValue> > Where <TKey, TValue>( this Dictionary <TKey, TValue> source, PredicateAt <KeyValuePair <TKey, TValue> > predicate) where TKey : notnull => ValueEnumerableExtensions.Where <ValueWrapper <TKey, TValue>, Dictionary <TKey, TValue> .Enumerator, KeyValuePair <TKey, TValue> >(new ValueWrapper <TKey, TValue>(source), predicate);
public static ValueEnumerableExtensions.WhereAtEnumerable <ValueWrapper <TKey, TValue>, SortedDictionary <TKey, TValue> .KeyCollection.Enumerator, TKey> Where <TKey, TValue>( this SortedDictionary <TKey, TValue> .KeyCollection source, PredicateAt <TKey> predicate) => ValueEnumerableExtensions.Where <ValueWrapper <TKey, TValue>, SortedDictionary <TKey, TValue> .KeyCollection.Enumerator, TKey>(new ValueWrapper <TKey, TValue>(source), predicate);
public static Option <TSource> Single <TSource>(this ImmutableStack <TSource> source) #pragma warning disable HLQ005 // Avoid Single() and SingleOrDefault() => ValueEnumerableExtensions.Single <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source));
public static Option <TSource> ElementAt <TSource>(this ImmutableStack <TSource> source, int index) => ValueEnumerableExtensions.ElementAt <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source), index);
public static Option <TSource> Single <TSource>(this ImmutableQueue <TSource> source) => ValueEnumerableExtensions.Single <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source));
#pragma warning restore HLQ005 // Avoid Single() and SingleOrDefault() public static ValueEnumerableExtensions.DistinctEnumerable <ValueWrapper <TKey, TValue>, Dictionary <TKey, TValue> .Enumerator, KeyValuePair <TKey, TValue> > Distinct <TKey, TValue>(this Dictionary <TKey, TValue> source, IEqualityComparer <KeyValuePair <TKey, TValue> >?comparer = default) where TKey : notnull => ValueEnumerableExtensions.Distinct <ValueWrapper <TKey, TValue>, Dictionary <TKey, TValue> .Enumerator, KeyValuePair <TKey, TValue> >(new ValueWrapper <TKey, TValue>(source), comparer);
public static Option <TSource> First <TSource>(this ImmutableStack <TSource> source) => ValueEnumerableExtensions.First <ValueWrapper <TSource>, ValueWrapper <TSource> .Enumerator, TSource>(new ValueWrapper <TSource>(source));