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)
// Signature: Seq.fold : ('State -> 'T -> 'State) -> 'State -> seq<'T> -> 'State // Usage: Seq.fold folder state source
The following code shows how to use Seq.fold to implement a function that computes the sum of the elements of a sequence.
The sum of the elements is 285.