FoldExtension.Fold<T, TResult> Method (IEnumerable<T>, Func<T, T, T, T, T, T, T, T, T, T, T, T, TResult>) |
Returns the result of applying a function to a sequence of
12 elements.
Namespace:
MoreLinq.Extensions
Assembly:
MoreLinq (in MoreLinq.dll) Version: 3.3.1+b77df70598ab84c28cd43dcf74594024b6d575e1
Syntaxpublic static TResult Fold<T, TResult>(
this IEnumerable<T> source,
Func<T, T, T, T, T, T, T, T, T, T, T, T, TResult> folder
)
<ExtensionAttribute>
Public Shared Function Fold(Of T, TResult) (
source As IEnumerable(Of T),
folder As Func(Of T, T, T, T, T, T, T, T, T, T, T, T, TResult)
) As TResult
public:
[ExtensionAttribute]
generic<typename T, typename TResult>
static TResult Fold(
IEnumerable<T>^ source,
Func<T, T, T, T, T, T, T, T, T, T, T, T, TResult>^ folder
)
[<ExtensionAttribute>]
static member Fold :
source : IEnumerable<'T> *
folder : Func<'T, 'T, 'T, 'T, 'T, 'T, 'T, 'T, 'T, 'T, 'T, 'T, 'TResult> -> 'TResult
Parameters
- source
- Type: System.Collections.Generic.IEnumerable<T>
The sequence of items to fold. - folder
- Type: System.Func<T, T, T, T, T, T, T, T, T, T, T, T, TResult>
Function to apply to the elements in the sequence.
Type Parameters
- T
- Type of element in the source sequence
- TResult
- Type of the result
Return Value
Type:
TResultThe folded value returned by
folder.
Usage Note
In Visual Basic and C#, you can call this method as an instance method on any object of type
IEnumerable<T>. 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).
ExceptionsException | Condition |
---|
ArgumentNullException | source is null |
ArgumentNullException | folder is null |
InvalidOperationException | source does not contain exactly 12 elements |
Remarks
This operator uses immediate execution and effectively buffers
as many items of the source sequence as necessary.
See Also