Successively applies the given function to the members of the sequence.
Sequence.Fold · [sequence] · [func]
- The sequence to fold.
- An accumulator function that receives two values and returns a new value, all of them having the same type as the members of the sequence.
A sequence containing the result of applying the given function to the members of the sequence, or an empty sequence if the original sequence was empty.
This function works by first calling
func and passing the first and second members of the sequence. Then, it passes the result and the third member of the sequence, and repeats this process until it reaches the last member.