Click or drag to resize

selectSelectT, R Method (ICollectionT, FuncT, R, FuncR, T)

Namespace:  WhetStone.Looping
Assembly:  WhetStone (in WhetStone.dll) Version: 1.0.4.0 (1.0.0.0)
Syntax
C#
public static ICollection<R> Select<T, R>(
	this ICollection<T> this,
	Func<T, R> selector,
	Func<R, T> inverse
)

Parameters

this
Type: System.Collections.GenericICollectionT
The ICollectionT to map.
selector
Type: SystemFuncT, R
The mapping function.
inverse
Type: SystemFuncR, T
The inverse of selector.

Type Parameters

T
The type of the original ICollectionT.
R
The type of the returned ICollectionT.

Return Value

Type: ICollectionR
A mutability passing ICollectionT with selector applied on this's elements.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type ICollectionT. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
Alongside allowing mutating this, the return value can optimize some methods:
Examples
var arr = range.IRange(-850,5000,9) //immutable, but searching is an O(1) operation.
var range+1 = arr.Select(a=>a+1,b=>b-1)
negPrimes.Contains(-53) //will perform O(1) operation, searching for -54 in an IRange.
See Also