Seq.fold<'T,'State> Function (F#)
Applies a function to each element of the collection, threading an accumulator argument through the computation. If the input function is f and the elements are i0...iN, then this function computes f (... (f s i0)...) iN.
Namespace/Module Path: Microsoft.FSharp.Collections.Seq
Assembly: FSharp.Core (in FSharp.Core.dll)
Type: 'State -> 'T -> 'State
A function that updates the state with each element from the sequence.
The initial state.
The input sequence.
Thrown when the input sequence is null.
The final result of the computation.
This function is named Fold in compiled assemblies. If you are accessing the function from a language other than F#, or through reflection, use this name.
The following code shows how to use Seq.fold to implement a function that computes the sum of the elements of a sequence.
Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2
F# Core Library Versions
Supported in: 2.0, 4.0, Portable