-
Notifications
You must be signed in to change notification settings - Fork 15
IndexedEnumerations
David Arno edited this page May 25, 2017
·
1 revision
Sometimes, when enumerating a collection, it is useful to have access to both the item itself, as well as the element's index in the collection. Succinc<T> provides an Indexed()
extension method that provides an IEnumerable<(int index, T item)>
enumeration:
var list = new List<int> { 1, 2, 3 };
var indexedList = list.Indexed();
foreach (var (index, item) in indexedList)
{
Console.WriteLine($"Item {index} = {item}.");
}
Action
/Func
conversionsCycle
methods- Converting between
Action
andFunc
- Extension methods for existing types that use
Option<T>
- Indexed enumerations
IEnumerable<T>
cons- Option-based parsers
- Partial function applications
- Pattern matching
- Pipe Operators
- Typed lambdas
Any
Either<TLeft,TRight>
None
Option<T>
Success<T>
Union<T1,T2>
Union<T1,T2,T3>
Union<T1,T2,T3,T4>
Unit
ValueOrError