Extension methods on IEnumerable<T>.
This type is thread safe.
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
See Also: Inherited members from object.
⊟ Public Methods
⊟ AggregateHistory<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> AggregateHistory<TSource> (this IEnumerable<TSource> self, Func<TSource, TSource, TSource> func)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- func
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ AggregateHistory<TSource,TAccumulate> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TAccumulate> AggregateHistory<TSource, TAccumulate> (this IEnumerable<TSource> self, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
- TAccumulate
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- seed
- Documentation for this section has not yet been entered.
- func
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ AggregateHistory<TSource,TAccumulate,TResult> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TResult> AggregateHistory<TSource, TAccumulate, TResult> (this IEnumerable<TSource> self, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, Func<TAccumulate, TResult> resultSelector)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
- TAccumulate
- Documentation for this section has not yet been entered.
- TResult
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- seed
- Documentation for this section has not yet been entered.
- func
- Documentation for this section has not yet been entered.
- resultSelector
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ AggregateReverse<TSource> Generic Method
Documentation for this section has not yet been entered.
public static TSource AggregateReverse<TSource> (this IEnumerable<TSource> self, Func<TSource, TSource, TSource> func)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- func
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. InvalidOperationException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ AggregateReverse<TSource,TAccumulate> Generic Method
Documentation for this section has not yet been entered.
public static TAccumulate AggregateReverse<TSource, TAccumulate> (this IEnumerable<TSource> self, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
- TAccumulate
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- seed
- Documentation for this section has not yet been entered.
- func
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ AggregateReverse<TSource,TAccumulate,TResult> Generic Method
Documentation for this section has not yet been entered.
public static TResult AggregateReverse<TSource, TAccumulate, TResult> (this IEnumerable<TSource> self, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, Func<TAccumulate, TResult> resultSelector)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
- TAccumulate
- Documentation for this section has not yet been entered.
- TResult
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- seed
- Documentation for this section has not yet been entered.
- func
- Documentation for this section has not yet been entered.
- resultSelector
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ AggregateReverseHistory<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> AggregateReverseHistory<TSource> (this IEnumerable<TSource> self, Func<TSource, TSource, TSource> func)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- func
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ AggregateReverseHistory<TSource,TAccumulate> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TAccumulate> AggregateReverseHistory<TSource, TAccumulate> (this IEnumerable<TSource> self, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
- TAccumulate
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- seed
- Documentation for this section has not yet been entered.
- func
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ AggregateReverseHistory<TSource,TAccumulate,TResult> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TResult> AggregateReverseHistory<TSource, TAccumulate, TResult> (this IEnumerable<TSource> self, TAccumulate seed, Func<TAccumulate, TSource, TAccumulate> func, Func<TAccumulate, TResult> resultSelector)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
- TAccumulate
- Documentation for this section has not yet been entered.
- TResult
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- seed
- Documentation for this section has not yet been entered.
- func
- Documentation for this section has not yet been entered.
- resultSelector
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ And Method
Documentation for this section has not yet been entered.
public static bool And (this IEnumerable<bool> self)⊟ Parameters
- self
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Apply<TSource> Generic Method
Documentation for this section has not yet been entered.
public static void Apply<TSource> (this IEnumerable<TSource> self)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ ApplyPairs<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> ApplyPairs<TSource> (this IEnumerable<TSource> self, params Action<TSource>[] actions)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- actions
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ AsIList<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IList<TSource> AsIList<TSource> (this IEnumerable<TSource> self)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Break<TSource> Generic Method
Documentation for this section has not yet been entered.
public static Cadenza.Tuple<IEnumerable<TSource>, IEnumerable<TSource>> Break<TSource> (this IEnumerable<TSource> self, Func<TSource, bool> func)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- func
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Cache<T> Generic Method
Documentation for this section has not yet been entered.
public static CachedSequence<T> Cache<T> (this IEnumerable<T> self)⊟ Type Parameters
- T
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ CompareWith<T> Generic Method
Compares two enumerations retrieving added, removed and unchanged elements.
public static SequenceComparison<T> CompareWith<T> (this IEnumerable<T> self, IEnumerable<T> update)⊟ Type Parameters
- T
- The type of the elements within self and update
⊟ Parameters
- self
- The original enumeration of elements.
- update
- The updated enumeration of elements to compare against.
⊟ Returns
An Cadenza.Collections.SequenceComparison<T> containing the added, removed and unchanged elements.⊟ Exceptions
Type Reason ArgumentNullException update is null. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ CompareWith<T> Generic Method
Compares two enumerations retrieving added, removed and unchanged elements.
public static SequenceComparison<T> CompareWith<T> (this IEnumerable<T> self, IEnumerable<T> update, IEqualityComparer<T> comparer)⊟ Type Parameters
- T
- The type of the elements within self and update
⊟ Parameters
- self
- The original enumeration of elements.
- update
- The updated enumeration of elements to compare against.
- comparer
- The stem.Collections.Generic.IEqualityComparer<T> used to compare equality.
⊟ Returns
An Cadenza.Collections.SequenceComparison<T> containing the added, removed and unchanged elements.⊟ Exceptions
Type Reason ArgumentNullException update is null. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Concat<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> Concat<TSource> (this IEnumerable<TSource> self, IEnumerable<IEnumerable<TSource>> selfs)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- selfs
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Concat<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> Concat<TSource> (this IEnumerable<TSource> self, params IEnumerable<TSource>[] selfs)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- selfs
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ ContiguousSubsequences<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<IEnumerable<TSource>> ContiguousSubsequences<TSource> (this IEnumerable<TSource> self, int windowSize)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- windowSize
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ CopyTo<TSource> Generic Method
Documentation for this section has not yet been entered.
public static void CopyTo<TSource> (this IEnumerable<TSource> self, ICollection<TSource> destination)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- destination
- Documentation for this section has not yet been entered.
⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ CopyTo<TSource> Generic Method
Documentation for this section has not yet been entered.
public static void CopyTo<TSource> (this IEnumerable<TSource> self, TSource[] array, int arrayIndex)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- array
- Documentation for this section has not yet been entered.
- arrayIndex
- Documentation for this section has not yet been entered.
⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ArgumentOutOfRangeException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Cycle<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> Cycle<TSource> (this IEnumerable<TSource> self)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Each<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> Each<TSource> (this IEnumerable<TSource> self, Action<TSource, int> action)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- action
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Each<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> Each<TSource> (this IEnumerable<TSource> self, Action<TSource> action)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- action
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ ExceptLast<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> ExceptLast<TSource> (this IEnumerable<TSource> self)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentException Documentation for this section has not yet been entered. ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ ExceptLast<TSource> Generic Method
Documentation for this section has not yet been entered.
⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- count
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentException Documentation for this section has not yet been entered. ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ FindIndex<TSource> Generic Method
Documentation for this section has not yet been entered.
public static int FindIndex<TSource> (this IEnumerable<TSource> self, Func<TSource, bool> predicate)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- predicate
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ FindIndices<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<int> FindIndices<TSource> (this IEnumerable<TSource> self, Func<TSource, bool> predicate)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- predicate
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ ForEach<TSource> Generic Method
Documentation for this section has not yet been entered.
⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- action
- Documentation for this section has not yet been entered.
⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ ForEach<TSource> Generic Method
Documentation for this section has not yet been entered.
⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- action
- Documentation for this section has not yet been entered.
⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ HaskellGroup<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<IEnumerable<TSource>> HaskellGroup<TSource> (this IEnumerable<TSource> self)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ HaskellGroupBy<TSource> Generic Method
Split self into a sequence of groups.
public static IEnumerable<IEnumerable<TSource>> HaskellGroupBy<TSource> (this IEnumerable<TSource> self, Func<TSource, TSource, bool> func)⊟ Type Parameters
- TSource
- The type of the elements within self.
⊟ Parameters
- self
- A IEnumerable<TSource> containing the elements to turn into groups.
- func
- A Func<TSource, TSource, bool> which is used to determine whether the TSource elements belong to the same group.
⊟ Returns
An IEnumerable<IEnumerable<TSource>> of groups.⊟ Exceptions
Type Reason ArgumentNullException self or func is null. ⊟ Remarks
A group is a continguence sequence of elements from self for which func(firstItemInTheGroup, currentItemInTheGroup) returns true. Once func returns false, a new group is created (and the next element within self is the first element of the new group).
C# Example // Split a string into pairs string s = "123456789"; int c = 0; List<List<char>> pairs = s.HaskellGroupBy(delegate { ++c; if (c < 2) return true; c = 0; return false; }).ToList(); Assert.AreEqual(5, pairs.Count); Assert.IsTrue(new[]{'1', '2'}.SequenceEqual (pairs [0])); Assert.IsTrue(new[]{'3', '4'}.SequenceEqual (pairs [1])); Assert.IsTrue(new[]{'5', '6'}.SequenceEqual (pairs [2])); Assert.IsTrue(new[]{'7', '8'}.SequenceEqual (pairs [3])); Assert.IsTrue(new[]{'9'}.SequenceEqual (pairs [4]));⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Implode<TSource> Generic Method
Documentation for this section has not yet been entered.
public static string Implode<TSource> (this IEnumerable<TSource> self)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Implode<TSource> Generic Method
Documentation for this section has not yet been entered.
⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- separator
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Implode<TSource> Generic Method
Documentation for this section has not yet been entered.
public static string Implode<TSource> (this IEnumerable<TSource> self, string separator, Func<TSource, string> selector)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- separator
- Documentation for this section has not yet been entered.
- selector
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ IndexOf<TSource> Generic Method
Documentation for this section has not yet been entered.
public static int IndexOf<TSource> (this IEnumerable<TSource> self, TSource value)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- value
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ IndexOfAny<TSource> Generic Method
Documentation for this section has not yet been entered.
⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- values
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ IndexOfAny<TSource> Generic Method
Documentation for this section has not yet been entered.
public static int IndexOfAny<TSource> (this IEnumerable<TSource> self, params TSource[] values)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- values
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ IndicesOf<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<int> IndicesOf<TSource> (this IEnumerable<TSource> self, TSource value)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- value
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ IndicesOfAny<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<int> IndicesOfAny<TSource> (this IEnumerable<TSource> self, IEnumerable<TSource> values)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- values
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ IndicesOfAny<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<int> IndicesOfAny<TSource> (this IEnumerable<TSource> self, params TSource[] values)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- values
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ InitialSegments<TSource> Generic Method
Creates a IEnumerable<IEnumerable<TSource>> containing all leading segments of self, shortest first.
public static IEnumerable<IEnumerable<TSource>> InitialSegments<TSource> (this IEnumerable<TSource> self)⊟ See Also
⊟ Type Parameters
- TSource
- The type of element in the sequence self.
⊟ Parameters
- self
- A IEnumerable<TSource> containing the sequence for which to return the initial segments.
⊟ Returns
A IEnumerable<IEnumerable<TSource>> containing all leading segments of self, shortest first.⊟ Exceptions
Type Reason ArgumentNullException self is null. ⊟ Remarks
A "leading segment" is the list of TSource values preceding the "current" index, in which the current index starts at the start of self and increments until the end of self.
C# Example IEnumerable<IEnumerable<char>> e = "abc".InitialSegments (); var l = e.ToList (); Assert.AreEqual (4, l.Count); AssertAreSame (new char[]{}, l [0]); AssertAreSame (new[]{'a'}, l [1]); AssertAreSame (new[]{'a', 'b'}, l [2]); AssertAreSame (new[]{'a', 'b', 'c'}, l [3]);⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Insert<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> Insert<TSource> (this IEnumerable<TSource> self, TSource value)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- value
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Insert<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> Insert<TSource> (this IEnumerable<TSource> self, TSource value, Func<TSource, TSource, int> func)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- value
- Documentation for this section has not yet been entered.
- func
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Intersperse<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> Intersperse<TSource> (this IEnumerable<IEnumerable<TSource>> self, IEnumerable<TSource> between)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- between
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Intersperse<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> Intersperse<TSource> (this IEnumerable<TSource> self, TSource value)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- value
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ NotNull<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> NotNull<TSource> (this IEnumerable<Nullable<TSource>> self)
where TSource : struct⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Or Method
Documentation for this section has not yet been entered.
public static bool Or (this IEnumerable<bool> self)⊟ Parameters
- self
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ OrderByNatural<TSource> Generic Method
Documentation for this section has not yet been entered.
public static IEnumerable<TSource> OrderByNatural<TSource> (this IEnumerable<TSource> self, Func<TSource, string> func)⊟ Type Parameters
- TSource
- Documentation for this section has not yet been entered.
⊟ Parameters
- self
- Documentation for this section has not yet been entered.
- func
- Documentation for this section has not yet been entered.
⊟ Returns
Documentation for this section has not yet been entered.⊟ Exceptions
Type Reason ArgumentNullException Documentation for this section has not yet been entered. ⊟ Remarks
Documentation for this section has not yet been entered.⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Partition<TSource> Generic Method
Partitions self into two sequences, those which contain elements satisfying predicate and those which do not.
public static Cadenza.Tuple<IEnumerable<TSource>, IEnumerable<TSource>> Partition<TSource> (this IEnumerable<TSource> self, Func<TSource, bool> predicate)⊟ Type Parameters
- TSource
- The type of the elements in self.
⊟ Parameters
- self
- A IEnumerable<TSource> containing the sequence to partition into elements which match predicate and those which do not.
- predicate
- A Func<TSource, bool> which is used to partition self into the set of elements for which predicate returns true and those for which predicate returns false.
⊟ Returns
A Cadenza.Tuple<IEnumerable<TSource>, IEnumerable<TSource>> in which Cadenza.Tuple<IEnumerable<TSource>, IEnumerable<TSource>>.Item1 contains the elements from self which satisfy predicate, and Cadenza.Tuple<IEnumerable<TSource>, IEnumerable<TSource>>.Item2 contains the elements which do not satisfy predicate.⊟ Exceptions
Type Reason ArgumentNullException self or predicate are null. ⊟ Remarks
C# Example Tuple<IEnumerable<int>, IEnumerable<int>> r = Enumerable.Range (1,6).Partition (x => x % 2 == 0); Assert.IsTrue (new[]{2, 4, 6}.SequenceEqual (r.Item1)); Assert.IsTrue (new[]{1, 3, 5}.SequenceEqual (r.Item2));⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ PathCombine Method
Creates a path string by concatenating the elements of self.
public static string PathCombine (this IEnumerable<string> self)⊟ Parameters
- self
- A IEnumerable<TSource> containing the values to combine into a path name.
⊟ Returns
A string which is the result of combining all the elements within self into a path name.⊟ Exceptions
Type Reason ArgumentException An element of self contains an invalid path character; see System.IO.Path.GetInvalidPathChars. ArgumentNullException self is null.
-or-
An element within self is null.
⊟ Remarks
Operation
For each element within self, if the current element is rooted (System.IO.Path.IsPathRooted(string)), then the current path string is dropped and the current element becomes the new path root. Otherwise, System.IO.Path.DirectorySeparatorChar is appended to the current path string and the current element is appended.
C# Example var data = new [] {"a", "b", "c"}; var result = string.Format ("a{0}b{0}c", Path.DirectorySeparatorChar); Assert.AreEqual (result, data.PathCombine ()); data = new [] { "a", String.Empty, "b", "c" }; Assert.AreEqual (result, data.PathCombine (), "empty elemetns"); string rooted = Path.DirectorySeparatorChar + "d"; data = new [] { "a", rooted }; Assert.AreEqual (rooted, data.PathCombine (), "rooted path2"); data = new [] { "a", "b", rooted, "c" }; string expected = Path.Combine (Path.Combine (Path.Combine ("a", "b"), rooted), "c"); Assert.AreEqual (expected, data.PathCombine (), "rooted path2 (complex)"); string end1 = "d" + Path.DirectorySeparatorChar; data = new [] { rooted, end1, "e" }; expected = Path.Combine (Path.Combine (rooted, end1), "e"); Assert.AreEqual (expected, data.PathCombine (), "DirectorySeparatorChar"); string end2 = "d" + Path.AltDirectorySeparatorChar; data = new [] { rooted, end2, "f" }; expected = Path.Combine (Path.Combine (rooted, end2), "f"); Assert.AreEqual (expected, data.PathCombine (), "AltDirectorySeparatorChar"); data = new [] { "a" }; Assert.AreEqual (Path.Combine ("a", String.Empty), data.PathCombine (), "single string"); data = new [] { String.Empty }; Assert.AreEqual (Path.Combine (String.Empty, String.Empty), data.PathCombine (), "single empty string");⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ RemoveFirstOccurrence<TSource> Generic Method
Removes the first occurrence of value from the sequence self.
public static IEnumerable<TSource> RemoveFirstOccurrence<TSource> (this IEnumerable<TSource> self, TSource value)⊟ See Also
⊟ Type Parameters
- TSource
- The type of the elements in self.
⊟ Parameters
- self
- A IEnumerable<TSource> containing the sequence from which to remove the first element equal to value.
- value
- A TSource which is the value to remove once from self.
⊟ Returns
A IEnumerable<TSource> which is a copy of self in which the first occurrence of value has been removed.⊟ Exceptions
Type Reason ArgumentNullException self is null. ⊟ Remarks
This is equivalent to calling self.RemoveFirstOccurrence(value, null).
C# Example Assert.AreEqual ("bnana", "banana".RemoveFirstOccurrence ('a').Implode ());⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ RemoveFirstOccurrence<TSource> Generic Method
Removes the first occurrence of value from the sequence self.
public static IEnumerable<TSource> RemoveFirstOccurrence<TSource> (this IEnumerable<TSource> self, TSource value, IEqualityComparer<TSource> comparer)⊟ Type Parameters
- TSource
- The type of the elements in self.
⊟ Parameters
- self
- A IEnumerable<TSource> containing the sequence from which to remove the first element equal to value.
- value
- A TSource which is the value to remove once from self.
- comparer
- A IEqualityComparer<TSource> to use when comparing elements from self to value. If null then EqualityComparer<TSource>.Default is used.
⊟ Returns
A IEnumerable<TSource> which is a copy of self in which the first occurrence of value has been removed.⊟ Exceptions
Type Reason ArgumentNullException self is null. ⊟ Remarks
C# Example Assert.AreEqual ("bnana", "banana".RemoveFirstOccurrence ('a').Implode ());⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ RemoveFirstOccurrences<TSource> Generic Method
Removes the first count occurrences of value from the sequence self.
public static IEnumerable<TSource> RemoveFirstOccurrences<TSource> (this IEnumerable<TSource> self, TSource value, int count)⊟ See Also
⊟ Type Parameters
- TSource
- The type of the elements in self.
⊟ Parameters
- self
- A IEnumerable<TSource> containing the sequence from which to remove the leading elements equal to value from.
- value
- A TSource which is the value to remove from the start of self.
- count
- A int containing the number of value elements to remove from self.
⊟ Returns
A IEnumerable<TSource> which is a copy of self in which the first count occurrences of value have been removed.⊟ Exceptions
Type Reason ArgumentNullException self is null. ArgumentOutOfRangeException count is negative. ⊟ Remarks
This is equivalent to calling self.RemoveFirstOccurrences(value, count, null).
C# Example Assert.AreEqual ("bnna", "banana".RemoveFirstOccurrences ('a', 2).Implode ());⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ RemoveFirstOccurrences<TSource> Generic Method
Removes the first count occurrences of value from the sequence self.
public static IEnumerable<TSource> RemoveFirstOccurrences<TSource> (this IEnumerable<TSource> self, TSource value, int count, IEqualityComparer<TSource> comparer)⊟ Type Parameters
- TSource
- The type of the elements in self.
⊟ Parameters
- self
- A IEnumerable<TSource> containing the sequence from which to remove the leading elements equal to value from.
- value
- A TSource which is the value to remove from the start of self.
- count
- A int containing the number of value elements to remove from self.
- comparer
- A IEqualityComparer<TSource> to use when comparing elements from self and value. If null then EqualityComparer<TSource>.Default is used.
⊟ Returns
A IEnumerable<TSource> which is a copy of self in which the first count occurrences of value have been removed.⊟ Exceptions
Type Reason ArgumentNullException self is null. ArgumentOutOfRangeException count is negative. ⊟ Remarks
C# Example Assert.AreEqual ("bnna", "banana".RemoveFirstOccurrences ('a', 2).Implode ());⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Repeat<TSource> Generic Method
Repeats the sequence self for number repetitions.
⊟ Type Parameters
- TSource
- The type of the elements in self.
⊟ Parameters
- self
- A IEnumerable<TSource> containing the sequence to repeat.
- number
- The number of times to repeat self.
⊟ Returns
A IEnumerable<TSource> sequence containing count * self.Count() elements, consisting of the sequence self, followed by the sequence self, etc.⊟ Exceptions
Type Reason ArgumentNullException self is null. ⊟ Remarks
C# Example Assert.AreEqual ("foofoofoo", new [] {"foo"}.Repeat (3).Implode ()); Assert.AreEqual ("foobarfoobar", new [] {"foo", "bar"}.Repeat (2).Implode ());⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ SelectAggregated<TSource,TAccumulate,TResult> Generic Method
Applies func to each element within self, returning the final value of the accumulator and the list of intermediate values.
public static Cadenza.Tuple<TAccumulate, List<TResult>> SelectAggregated<TSource, TAccumulate, TResult> (this IEnumerable<TSource> self, TAccumulate seed, Func<TAccumulate, TSource, Cadenza.Tuple<TAccumulate, TResult>> func)⊟ Type Parameters
- TSource
- The type of the elements within self.
- TAccumulate
- The type of the accumulator value.
- TResult
- The type of the return value.
⊟ Parameters
- self
- A IEnumerable<TSource> containing the sequence to return the values of successive System.Linq.Enumerable.Select``2(IEnumerable<``0>, Func<``0, ``1>) and EnumerableCoda.AggregateReverse``3(IEnumerable<``0>, ``1, Func<``1, ``0, ``1>, Func<``1, ``2>) calls from.
- seed
- The first TAccumulate value to pass to func.
- func
- A Func<TAccumulate, TSource, Cadenza.Tuple<TAccumulate, TResult>> which is applied against each element within self and the current TAccumulate value (initially using seed), generating the next accumulated value and the (partial) result value.
⊟ Returns
A Cadenza.Tuple<TAccumulate, List<TResult>> which contains the final accumulated value in Cadenza.Tuple<TAccumulate, List<TResult>>.Item1 and the list of intermediate results in Cadenza.Tuple<TAccumulate, List<TResult>>.Item2.⊟ Exceptions
Type Reason ArgumentNullException self or func is null. ⊟ Remarks
This is Haskell's mapAccumL.
C# Example IEnumerable<int> s = new []{2, 3, 4, 5}; Tuple<int, List<string>> r = s.SelectAggregated (1, (a,b) => Tuple.Create (a-b, "s" + (a-b))); Assert.AreEqual (-13, r.Item1); Assert.IsTrue (new[]{ "s-1", "s-4", "s-8", "s-13", }.SequenceEqual (r.Item2)); r = new int[]{}.SelectAggregated (42, (a,b) => Tuple.Create (a-b, b.ToString ())); Assert.AreEqual (42, r.Item1); Assert.AreEqual (0, r.Item2.Count);⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ SelectBreadthFirst<TSource,TResult> Generic Method
Traverse a sequence of nodes in a breadth-first fashion, converting each encountered node.
public static IEnumerable<TResult> SelectBreadthFirst<TSource, TResult> (this IEnumerable<TSource> self, Func<TSource, TResult> valueSelector, Func<TSource, IEnumerable<TSource>> childrenSelector)⊟ Type Parameters
- TSource
- The type of the root nodes and intermediate nodes of the tree.
- TResult
- The type of the object to return.
⊟ Parameters
- self
- A IEnumerable<TSource> containing the elements to perform a breadth-first traversal on.
- valueSelector
- A Func<TSource, TResult> which is used to convert tree nodes into TResult instances.
- childrenSelector
- A Func<TSource, IEnumerable<TSource>> which returns the child nodes of root and all intermediate non-leaf nodes.
⊟ Returns
A IEnumerable<TResult> containing the result of applying valueSelector to all nodes encountered while traversing the forest self in a breadth-first fashion.⊟ Exceptions
Type Reason ArgumentNullException self is null.
-or-
childrenSelector is null.
-or-
valueSelector is null.
⊟ Remarks
self is a "forest", a sequence of tree roots (siblings), wherein each node is a data structure containing a value and child nodes. The value is retrieved via valueSelector, and the children are obtained via childrenSelector.
Each node is traversed in a breadth-first fashion, with each encountered node is provided to valueSelector, and the values are returned.
⊟ Example
Given the TreeNode<T> declaration:
C# Example class TreeNode<T> { public TreeNode () { Children = new TreeNode<T> [0]; } public T Value; public IEnumerable<TreeNode<T>> Children; }SelectBreadthFirst() is used as:
C# Example TreeNode<int>[] root = new TreeNode<int>[] { new TreeNode<int> { Value = 1, Children = new [] { new TreeNode<int> { Value = 2 }, new TreeNode<int> { Value = 3, Children = new [] { new TreeNode<int> { Value = 5 }, } }, new TreeNode<int> { Value = 4 }, } }, new TreeNode<int> { Value = -1 }, }; IEnumerable<int> values = root .SelectBreadthFirst (x => x.Value, x => x.Children); AssertAreSame (new[]{ 1, 2, 3, 4, 5, -1 }, values);⊟ Requirements
Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ SelectDepthFirst<TSource,TResult> Generic Method
Traverse a sequence of nodes in a depth-first fashion, converting each encountered node.
public static IEnumerable<TResult> SelectDepthFirst<TSource, TResult> (this IEnumerable<TSource> self, Func<TSource, TResult> valueSelector, Func<TSource, IEnumerable<TSource>> childrenSelector)⊟ Type Parameters
- TSource
- The type of the root nodes and intermediate nodes of the tree.
- TResult
- The type of the object to return.
⊟ Parameters
- self
- A IEnumerable<TSource> containing the elements to perform a depth-first traversal on.
- valueSelector
- A Func<TSource, TResult> which is used to convert tree nodes into TResult instances.
- childrenSelector
- A Func<TSource, IEnumerable<TSource>> which returns the child nodes of an element in self (and grand-children, and great-grandchildren, and...).
⊟ Returns
A IEnumerable<TResult> containing the result of applying valueSelector to all nodes encountered while traversing the forest self in a depth-first fashion.⊟ Exceptions
Type Reason ArgumentNullException self is null.
-or-
childrenSelector is null.
-or-
valueSelector is null.
⊟ Remarks
self is a "forest", a sequence of tree roots (siblings), wherein each node is a data structure containing a value and child nodes. The value is retrieved via valueSelector, and the children are obtained via childrenSelector.
The tree is traversed in a depth-first fashion, each encountered node is provided to valueSelector, and the values are returned.