Additional extension methods for IEnumerable{T}, IReadOnlyCollection{T}, and ICollection{T}, beyond what LINQ provides.
More...
Additional extension methods for IEnumerable{T}, IReadOnlyCollection{T}, and ICollection{T}, beyond what LINQ provides.
The methods include WithIndexes{T}, which pairs each item of a sequence with a 0-based index of that item; ForEach{T}, which runs a lambda for each member of a sequence; IndexWhere{T}, which finds the index where a predicate is true; AdjacentPairs{T}, which pairs each list item with the next one, and MinOrDefault, which finds the item such that some associated value is minimized (in contrast to LINQ's Min(), which just returns the minimum value itself.) And there's more.
|
|
static BufferedSequence< T > | Buffered< T > (this IEnumerator< T > source) |
| |
|
static BufferedSequence< T > | Buffered< T > (this IEnumerable< T > source) |
| |
|
static IListSource< T > | Buffered< T > (this IListSource< T > source) |
| |
| static IReadOnlyCollection< T > | AsReadOnly< T > (this ICollection< T > c) |
| | Treats any ICollection{T} object to IReadOnlyCollection{T}. More...
|
| |
| static IReadOnlyDictionary< K, V > | AsReadOnlyDictionary< K, V > (this IReadOnlyCollection< K > keys, Func< K, Maybe< V >> tryGetValue, Func< K, V >?getValue=null) |
| | Converts a collection of keys to an IReadOnlyDictionary, based on a function that can obtain a value for a given key. More...
|
| |
|
static void | ForEach< T > (this IEnumerable< T > list, Action< T > action) |
| |
static IEnumerable
< KeyValuePair< int, T > > | WithIndexes< T > (this IEnumerable< T > c) |
| |
| static int | FirstIndexWhere< T > (this IEnumerable< T > list, Func< T, bool > pred) |
| | Gets the lowest index at which a condition is true, or null if nowhere. More...
|
| |
| static int | IndexWhere< T > (this IEnumerable< T > list, Func< T, bool > pred) |
| | Gets the lowest index at which a condition is true, or -1 if nowhere. More...
|
| |
| static int | IndexOfMin (this IEnumerable< int > source) |
| | Finds the minimum element's index in the list More...
|
| |
| static int | IndexOfMin< T > (this IEnumerable< T > source, Func< T, int > selector) |
| | Finds the minimum element's index in the list More...
|
| |
| static int | IndexOfMin< T > (this IEnumerable< T > source, Func< T, int > selector, [MaybeNull] out T min) |
| | Finds the minimum element's index in the list, and returns it with the item itself More...
|
| |
| static int | IndexOfMin< T > (this IEnumerable< T > source) |
| | Finds the minimum element's index in the list More...
|
| |
| static int | IndexOfMin< T, R > (this IEnumerable< T > source, Func< T, R > selector) |
| | Finds the minimum element's index in the list More...
|
| |
| static int | IndexOfMin< T, R > (this IEnumerable< T > source, Func< T, R > selector, [MaybeNull] out T min) |
| | Finds the minimum element's index in the list More...
|
| |
| static T | MinItemOrDefault< T > (this IEnumerable< T > list, Func< T, int > selector, [AllowNull] T defaultValue=default(T)) |
| | Finds the minimum element in the list (given some selector) and returns it More...
|
| |
|
static T | MinItemOrDefault< T, S > (this IEnumerable< T > list, Func< T, S > selector, [AllowNull] T defaultValue=default(T)) |
| |
|
static T | MinOrDefault< T > (this IEnumerable< T > list, Func< T, int > selector, [AllowNull] T defaultValue=default(T)) |
| |
| static Maybe< T > | MinItem< T > (this IEnumerable< T > list, Func< T, int > selector) |
| | Finds the minimum element (as determined by the selector) and returns it. If the list is empty, an empty Maybe{T} value is returned. More...
|
| |
| static Maybe< T > | MinItem< T, S > (this IEnumerable< T > list, Func< T, S > selector) |
| | Finds the minimum element (as determined by the selector) and returns it. If the list is empty, an empty Maybe{T} value is returned. More...
|
| |
| static int | IndexOfMax (this IEnumerable< int > source) |
| | Finds the maximum element's index in the list More...
|
| |
| static int | IndexOfMax< T > (this IEnumerable< T > source, Func< T, int > selector) |
| | Finds the maximum element's index in the list More...
|
| |
| static int | IndexOfMax< T > (this IEnumerable< T > source, Func< T, int > selector, [MaybeNull] out T min) |
| | Finds the maximum element's index in the list, and returns it with the item itself More...
|
| |
| static int | IndexOfMax< T > (this IEnumerable< T > source) |
| | Finds the maximum element's index in the list More...
|
| |
| static int | IndexOfMax< T, R > (this IEnumerable< T > source, Func< T, R > selector) |
| | Finds the maximum element's index in the list More...
|
| |
| static int | IndexOfMax< T, R > (this IEnumerable< T > source, Func< T, R > selector, [MaybeNull] out T min) |
| | Finds the maximum element's index in the list More...
|
| |
| static T | MaxItemOrDefault< T > (this IEnumerable< T > list, Func< T, int > selector, [AllowNull] T defaultValue=default(T)) |
| | Finds the maximum element in the list (given some selector) and returns it More...
|
| |
|
static T | MaxItemOrDefault< T, S > (this IEnumerable< T > list, Func< T, S > selector, [AllowNull] T defaultValue=default(T)) |
| |
|
static T | MaxOrDefault< T > (this IEnumerable< T > list, Func< T, int > selector, [AllowNull] T defaultValue=default(T)) |
| |
| static Maybe< T > | MaxItem< T > (this IEnumerable< T > list, Func< T, int > selector) |
| | Finds the maximum element (as determined by the selector) and returns it. If the list is empty, an empty Maybe{T} value is returned. More...
|
| |
| static Maybe< T > | MaxItem< T, S > (this IEnumerable< T > list, Func< T, S > selector) |
| | Finds the maximum element (as determined by the selector) and returns it. If the list is empty, an empty Maybe{T} value is returned. More...
|
| |
|
static IEnumerable< T > | WhereNotNull< T > (this IEnumerable< T?> list) |
| |
|
static IEnumerable< T > | WhereNotNull< T > (this IEnumerable< T?> list) |
| |
| static IEnumerable< Out > | SelectFilter< T, Out > (this IEnumerable< T > list, Func< T, Maybe< Out >> filter) |
| | Combines 'Select' and 'Where' in a single operation. More...
|
| |
| static int | IndexOf< T > (this IEnumerable< T > list, T item) |
| | Determines the index of a specific value. More...
|
| |
|
static int | IndexOf< T > (this IEnumerable< T > list, T item, IEqualityComparer< T > comp) |
| |
| static int | SequenceHashCode< T > (this IEnumerable< T > list) |
| | A companion to Enumerable.SequenceEqual{T} that computes a hashcode for a list. More...
|
| |
|
static int | SequenceHashCode< T > (this IEnumerable< T > list, IEqualityComparer< T > comp) |
| |
| static IEnumerable< Base > | Upcast< Base, Derived > (this IEnumerable< Derived > list) |
| | Upcasts a sequence. More...
|
| |
| static IEnumerable< Pair< T, T > > | AdjacentPairs< T > (this IEnumerable< T > list) |
| | Returns all adjacent pairs (e.g. for the list {1,2,3}, returns {(1,2),(2,3)}) More...
|
| |
|
static IEnumerable< Pair< T, T > > | AdjacentPairs< T > (this IEnumerator< T > e) |
| |
| static IEnumerable< Pair< T, T > > | AdjacentPairsCircular< T > (this IEnumerable< T > list) |
| | Returns all adjacent pairs, treating the first and last pairs as adjacent (e.g. for the list {1,2,3,4}, returns the pairs {(1,2),(2,3),(3,4),(4,1)}.) More...
|
| |
|
static IEnumerable< Pair< T, T > > | AdjacentPairsCircular< T > (this IEnumerator< T > e) |
| |
|
static List< T > | ToList< T > (this IEnumerator< T > e) |
| |