Cadenza : Cadenza.Collections Namespace

EnumerableCoda Class

Extension methods on IEnumerable<T>.

public static class EnumerableCoda

Thread Safety

This type is thread safe.

Remarks

Requirements

Namespace: Cadenza.Collections
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0

Members

See Also: Inherited members from object.

Public Methods

static
AggregateHistory<TSource> (this IEnumerable<TSource>, Func<TSource, TSource, TSource>) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
AggregateHistory<TSource,TAccumulate> (this IEnumerable<TSource>, TAccumulate, Func<TAccumulate, TSource, TAccumulate>) : IEnumerable<TAccumulate>
Documentation for this section has not yet been entered.
static
AggregateHistory<TSource,TAccumulate,TResult> (this IEnumerable<TSource>, TAccumulate, Func<TAccumulate, TSource, TAccumulate>, Func<TAccumulate, TResult>) : IEnumerable<TResult>
Documentation for this section has not yet been entered.
static
AggregateReverse<TSource> (this IEnumerable<TSource>, Func<TSource, TSource, TSource>) : TSource
Documentation for this section has not yet been entered.
static
AggregateReverse<TSource,TAccumulate> (this IEnumerable<TSource>, TAccumulate, Func<TAccumulate, TSource, TAccumulate>) : TAccumulate
Documentation for this section has not yet been entered.
static
AggregateReverse<TSource,TAccumulate,TResult> (this IEnumerable<TSource>, TAccumulate, Func<TAccumulate, TSource, TAccumulate>, Func<TAccumulate, TResult>) : TResult
Documentation for this section has not yet been entered.
static
AggregateReverseHistory<TSource> (this IEnumerable<TSource>, Func<TSource, TSource, TSource>) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
AggregateReverseHistory<TSource,TAccumulate> (this IEnumerable<TSource>, TAccumulate, Func<TAccumulate, TSource, TAccumulate>) : IEnumerable<TAccumulate>
Documentation for this section has not yet been entered.
static
AggregateReverseHistory<TSource,TAccumulate,TResult> (this IEnumerable<TSource>, TAccumulate, Func<TAccumulate, TSource, TAccumulate>, Func<TAccumulate, TResult>) : IEnumerable<TResult>
Documentation for this section has not yet been entered.
static
And (this IEnumerable<bool>) : bool
Documentation for this section has not yet been entered.
static
Apply<TSource> (this IEnumerable<TSource>)
Documentation for this section has not yet been entered.
static
ApplyPairs<TSource> (this IEnumerable<TSource>, params Action<TSource>[]) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
AsIList<TSource> (this IEnumerable<TSource>) : IList<TSource>
Documentation for this section has not yet been entered.
static
Break<TSource> (this IEnumerable<TSource>, Func<TSource, bool>) : Cadenza.Tuple<IEnumerable<TSource>, IEnumerable<TSource>>
Documentation for this section has not yet been entered.
static
Cache<T> (this IEnumerable<T>) : CachedSequence<T>
Documentation for this section has not yet been entered.
static
CompareWith<T> (this IEnumerable<T>, IEnumerable<T>) : SequenceComparison<T>
Compares two enumerations retrieving added, removed and unchanged elements.
static
CompareWith<T> (this IEnumerable<T>, IEnumerable<T>, IEqualityComparer<T>) : SequenceComparison<T>
Compares two enumerations retrieving added, removed and unchanged elements.
static
Concat<TSource> (this IEnumerable<TSource>, IEnumerable<IEnumerable<TSource>>) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
Concat<TSource> (this IEnumerable<TSource>, params IEnumerable<TSource>[]) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
ContiguousSubsequences<TSource> (this IEnumerable<TSource>, int) : IEnumerable<IEnumerable<TSource>>
Documentation for this section has not yet been entered.
static
CopyTo<TSource> (this IEnumerable<TSource>, ICollection<TSource>)
Documentation for this section has not yet been entered.
static
CopyTo<TSource> (this IEnumerable<TSource>, TSource[], int)
Documentation for this section has not yet been entered.
static
Cycle<TSource> (this IEnumerable<TSource>) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
Each<TSource> (this IEnumerable<TSource>, Action<TSource, int>) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
Each<TSource> (this IEnumerable<TSource>, Action<TSource>) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
ExceptLast<TSource> (this IEnumerable<TSource>) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
ExceptLast<TSource> (this IEnumerable<TSource>, int) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
FindIndex<TSource> (this IEnumerable<TSource>, Func<TSource, bool>) : int
Documentation for this section has not yet been entered.
static
FindIndices<TSource> (this IEnumerable<TSource>, Func<TSource, bool>) : IEnumerable<int>
Documentation for this section has not yet been entered.
static
ForEach<TSource> (this IEnumerable<TSource>, Action<TSource, int>)
Documentation for this section has not yet been entered.
static
ForEach<TSource> (this IEnumerable<TSource>, Action<TSource>)
Documentation for this section has not yet been entered.
static
HaskellGroup<TSource> (this IEnumerable<TSource>) : IEnumerable<IEnumerable<TSource>>
Documentation for this section has not yet been entered.
static
HaskellGroupBy<TSource> (this IEnumerable<TSource>, Func<TSource, TSource, bool>) : IEnumerable<IEnumerable<TSource>>
Split self into a sequence of groups.
static
Implode<TSource> (this IEnumerable<TSource>) : string
Documentation for this section has not yet been entered.
static
Implode<TSource> (this IEnumerable<TSource>, string) : string
Documentation for this section has not yet been entered.
static
Implode<TSource> (this IEnumerable<TSource>, string, Func<TSource, string>) : string
Documentation for this section has not yet been entered.
static
IndexOf<TSource> (this IEnumerable<TSource>, TSource) : int
Documentation for this section has not yet been entered.
static
IndexOfAny<TSource> (this IEnumerable<TSource>, IEnumerable<TSource>) : int
Documentation for this section has not yet been entered.
static
IndexOfAny<TSource> (this IEnumerable<TSource>, params TSource[]) : int
Documentation for this section has not yet been entered.
static
IndicesOf<TSource> (this IEnumerable<TSource>, TSource) : IEnumerable<int>
Documentation for this section has not yet been entered.
static
IndicesOfAny<TSource> (this IEnumerable<TSource>, IEnumerable<TSource>) : IEnumerable<int>
Documentation for this section has not yet been entered.
static
IndicesOfAny<TSource> (this IEnumerable<TSource>, params TSource[]) : IEnumerable<int>
Documentation for this section has not yet been entered.
static
InitialSegments<TSource> (this IEnumerable<TSource>) : IEnumerable<IEnumerable<TSource>>
Creates a IEnumerable<IEnumerable<TSource>> containing all leading segments of self, shortest first.
static
Insert<TSource> (this IEnumerable<TSource>, TSource) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
Insert<TSource> (this IEnumerable<TSource>, TSource, Func<TSource, TSource, int>) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
Intersperse<TSource> (this IEnumerable<IEnumerable<TSource>>, IEnumerable<TSource>) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
Intersperse<TSource> (this IEnumerable<TSource>, TSource) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
NotNull<TSource> (this IEnumerable<Nullable<TSource>>) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
Or (this IEnumerable<bool>) : bool
Documentation for this section has not yet been entered.
static
OrderByNatural<TSource> (this IEnumerable<TSource>, Func<TSource, string>) : IEnumerable<TSource>
Documentation for this section has not yet been entered.
static
Partition<TSource> (this IEnumerable<TSource>, Func<TSource, bool>) : Cadenza.Tuple<IEnumerable<TSource>, IEnumerable<TSource>>
Partitions self into two sequences, those which contain elements satisfying predicate and those which do not.
static
PathCombine (this IEnumerable<string>) : string
Creates a path string by concatenating the elements of self.
static
RemoveFirstOccurrence<TSource> (this IEnumerable<TSource>, TSource) : IEnumerable<TSource>
Removes the first occurrence of value from the sequence self.
static
RemoveFirstOccurrence<TSource> (this IEnumerable<TSource>, TSource, IEqualityComparer<TSource>) : IEnumerable<TSource>
Removes the first occurrence of value from the sequence self.
static
RemoveFirstOccurrences<TSource> (this IEnumerable<TSource>, TSource, int) : IEnumerable<TSource>
Removes the first count occurrences of value from the sequence self.
static
RemoveFirstOccurrences<TSource> (this IEnumerable<TSource>, TSource, int, IEqualityComparer<TSource>) : IEnumerable<TSource>
Removes the first count occurrences of value from the sequence self.
static
Repeat<TSource> (this IEnumerable<TSource>, int) : IEnumerable<TSource>
Repeats the sequence self for number repetitions.
static
SelectAggregated<TSource,TAccumulate,TResult> (this IEnumerable<TSource>, TAccumulate, Func<TAccumulate, TSource, Cadenza.Tuple<TAccumulate, TResult>>) : Cadenza.Tuple<TAccumulate, List<TResult>>
Applies func to each element within self, returning the final value of the accumulator and the list of intermediate values.
static
SelectBreadthFirst<TSource,TResult> (this IEnumerable<TSource>, Func<TSource, TResult>, Func<TSource, IEnumerable<TSource>>) : IEnumerable<TResult>
Traverse a sequence of nodes in a breadth-first fashion, converting each encountered node.
static
SelectDepthFirst<TSource,TResult> (this IEnumerable<TSource>, Func<TSource, TResult>, Func<TSource, IEnumerable<TSource>>) : IEnumerable<TResult>
Traverse a sequence of nodes in a depth-first fashion, converting each encountered node.
static
SelectFromEach<T1,T2,TResult> (this IEnumerable<T1>, IEnumerable<T2>, Func<T1, T2, TResult>) : IEnumerable<TResult>
Projects each corresponding element from multiple sequences into a new form.
static
SelectFromEach<T1,T2,T3,TResult> (this IEnumerable<T1>, IEnumerable<T2>, IEnumerable<T3>, Func<T1, T2, T3, TResult>) : IEnumerable<TResult>
Projects each corresponding element from multiple sequences into a new form.
static
SelectFromEach<T1,T2,T3,T4,TResult> (this IEnumerable<T1>, IEnumerable<T2>, IEnumerable<T3>, IEnumerable<T4>, Func<T1, T2, T3, T4, TResult>) : IEnumerable<TResult>
Projects each corresponding element from multiple sequences into a new form.
static
SelectReverseAggregated<TSource,TAccumulate,TResult> (this IEnumerable<TSource>, TAccumulate, Func<TAccumulate, TSource, Cadenza.Tuple<TAccumulate, TResult>>) : Cadenza.Tuple<TAccumulate, List<TResult>>
Applies func to each element within self in reverse order, returning the final value of the accumulator and the list of intermediate values.
static
SequenceCompare<TSource> (this IEnumerable<TSource>, IEnumerable<TSource>) : int
Compares the elements of two sequences by using the default comparer for their type.
static
SequenceCompare<TSource> (this IEnumerable<TSource>, IEnumerable<TSource>, IComparer<TSource>) : int
Compares the elements of two sequences by using a specified IComparer<TSource>.
static
Shuffle<TSource> (this IEnumerable<TSource>) : IEnumerable<TSource>
Randomizes the ordering of items within self.
static
Shuffle<TSource> (this IEnumerable<TSource>, Random) : IEnumerable<TSource>
Randomizes the ordering of items within self.
static
SkipPrefix<TSource> (this IEnumerable<TSource>, IEnumerable<TSource>) : IEnumerable<TSource>
Skips over prefix, returning the elements following prefix.
static
SkipPrefix<TSource> (this IEnumerable<TSource>, IEnumerable<TSource>, IEqualityComparer<TSource>) : IEnumerable<TSource>
Skips over prefix, returning the elements following prefix.
static
Sort<TSource> (this IEnumerable<TSource>) : IEnumerable<TSource>
Sorts the elements in the sequence self using the default comparer.
static
Sort<TSource> (this IEnumerable<TSource>, IComparer<TSource>) : IEnumerable<TSource>
Sorts the elements in the sequence self using the specified comparer.
static
Sort<TSource> (this IEnumerable<TSource>, Comparison<TSource>) : IEnumerable<TSource>
Sorts the elements in the sequence self using the specified comparer.
static
SortNatural (this IEnumerable<string>) : IEnumerable<string>
Returns a new IEnumerable<TSource> which contains the elements within self sorted using the Cadenza.NaturalStringComparer.Default comparer.
static
Span<TSource> (this IEnumerable<TSource>, Func<TSource, bool>) : Cadenza.Tuple<IEnumerable<TSource>, IEnumerable<TSource>>
Creates a Cadenza.Tuple<IEnumerable<TSource>, IEnumerable<TSource>> of the contiguous elements at the start of self which satisfy predicate.
static
SplitAt<TSource> (this IEnumerable<TSource>, int) : Cadenza.Tuple<IEnumerable<TSource>, IEnumerable<TSource>>
Splits self at firstLength, creating a Cadenza.Tuple<IEnumerable<TSource>, IEnumerable<TSource>>.
static
Subsets<TSource> (this IEnumerable<TSource>) : IEnumerable<IEnumerable<TSource>>
Creates all subsets of a given input sequence.
static
Subsets<TSource> (this IEnumerable<TSource>, Func<IEnumerable<TSource>,System.Boolean>) : IEnumerable<IEnumerable<TSource>>
Creates all subsets that match predicate.
static
Tokens<TSource,TAccumulate,TResult> (this IEnumerable<TSource>, TAccumulate, Func<TAccumulate, TSource, TAccumulate>, Func<TAccumulate, Cadenza.Tuple<TResult, TAccumulate>>, params Func<TAccumulate, TSource, bool>[]) : IEnumerable<TResult>
A simple lexer to convert an IEnumerable<TSource> into a IEnumerable<TResult>, where the resulting sequence may have a different number of elements than the source sequence.
static
ToList<TSource> (this IEnumerable<IEnumerable<TSource>>) : List<List<TSource>>
Creates a List<List<TSource>> with the same ordering and values as self.
static
ToReadOnlyDictionary<TSource,TKey> (this IEnumerable<TSource>, Func<TSource, TKey>) : ReadOnlyDictionary<TKey, TSource>
Creates a Cadenza.Collections.ReadOnlyDictionary<TKey, TSource> from an IEnumerable<TSource> according to a specified key selector and value selector delegate.
static
ToReadOnlyDictionary<TSource,TKey,TValue> (this IEnumerable<TSource>, Func<TSource, TKey>, Func<TSource, TValue>) : ReadOnlyDictionary<TKey, TValue>
Creates a Cadenza.Collections.ReadOnlyDictionary<TKey, TValue> from an IEnumerable<TSource> according to a specified key selector and value selector delegate.
static
ToTuple (this IEnumerable) : object
Creates a Tuple from a sequence.
static
ToValueReader (this IEnumerable<string>) : Cadenza.IO.TextValueReader
Creates a Cadenza.IO.TextValueReader which will extract values from an IEnumerable<string>.
static
ToValueReader<TSource> (this IEnumerable<TSource>) : Cadenza.IO.EnumerableValueReader<TSource>
Creates a Cadenza.IO.EnumerableValueReader which will extract values from an IEnumerable<TSource>.
static
TrailingSegments<TSource> (this IEnumerable<TSource>) : IEnumerable<IEnumerable<TSource>>
Creates a IEnumerable<IEnumerable<TSource>> containing all final segments of self, longest first.
static
Transpose<TSource> (this IEnumerable<IEnumerable<TSource>>) : IEnumerable<IEnumerable<TSource>>
Transposes self, so that rows become columns and columns become rows in the returned IEnumerable<IEnumerable<TSource>>.
static
TryGetFirst<TSource> (this IEnumerable<TSource>, out TSource) : bool
Attempts to obtain the first element in the sequence.
static
TryGetFirst<TSource> (this IEnumerable<TSource>, Func<TSource, bool>, out TSource) : bool
Attempts to obtain the first element in the sequence that satisfies the specified condition.
static
Unzip<T1,T2> (this IEnumerable<Cadenza.Tuple<T1, T2>>) : Cadenza.Tuple<IEnumerable<T1>, IEnumerable<T2>>
Converts an IEnumerable<Cadenza.Tuple<T1, T2>> into a tuple of lists, one for each Cadenza.Tuple<T1, T2> element.
static
Unzip<T1,T2,T3> (this IEnumerable<Cadenza.Tuple<T1, T2, T3>>) : Cadenza.Tuple<IEnumerable<T1>, IEnumerable<T2>, IEnumerable<T3>>
Converts an IEnumerable<Cadenza.Tuple<T1, T2, T3>> into a tuple of lists, one for each Cadenza.Tuple<T1, T2, T3> element.
static
Unzip<T1,T2,T3,T4> (this IEnumerable<Cadenza.Tuple<T1, T2, T3, T4>>) : Cadenza.Tuple<IEnumerable<T1>, IEnumerable<T2>, IEnumerable<T3>, IEnumerable<T4>>
Converts an IEnumerable<Cadenza.Tuple<T1, T2, T3, T4>> into a tuple of lists, one for each Cadenza.Tuple<T1, T2, T3, T4> element.
static
Zip<T1,T2> (this IEnumerable<T1>, IEnumerable<T2>) : IEnumerable<Cadenza.Tuple<T1, T2>>
Creates and returns an IEnumerable<Cadenza.Tuple<T1, T2>> containing the corresponding items from self and source2.
static
Zip<T1,T2,T3> (this IEnumerable<T1>, IEnumerable<T2>, IEnumerable<T3>) : IEnumerable<Cadenza.Tuple<T1, T2, T3>>
Creates and returns an IEnumerable<Cadenza.Tuple<T1, T2, T3>> containing the corresponding items from self, source2, and source3.
static
Zip<T1,T2,T3,T4> (this IEnumerable<T1>, IEnumerable<T2>, IEnumerable<T3>, IEnumerable<T4>) : IEnumerable<Cadenza.Tuple<T1, T2, T3, T4>>
Creates and returns an IEnumerable<Cadenza.Tuple<T1, T2, T3, T4>> containing the corresponding items from self, source2, source3, and source4.

Member Details

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.

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.

public static IEnumerable<TSource> ExceptLast<TSource> (this IEnumerable<TSource> self, int count)

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.

public static void ForEach<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.

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.

public static void ForEach<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.

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.

public static string Implode<TSource> (this IEnumerable<TSource> self, string separator)

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.

public static int IndexOfAny<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

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

EnumerableCoda.TrailingSegments``1(IEnumerable<``0>)

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.

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

EnumerableCoda.RemoveFirstOccurrence``1(IEnumerable<``0>, ``0, IEqualityComparer<``0>)

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

EnumerableCoda.RemoveFirstOccurrences``1(IEnumerable<``0>, ``0, int, IEqualityComparer<``0>)

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.

public static IEnumerable<TSource> Repeat<TSource> (this IEnumerable<TSource> self, int number)

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.