Fold
Reduce a collection to one value, combining left to right from a seed.
✓ checked against that system · ! checked, with disagreements (hover a chip)Wolfram Language
Fold!Fold(f, init, xs) — combined with each element of in turn.Fold(f)the operator form, .Fold(f, xs)the same fold with no seed, starting from 's own first element: .Typed signatures
| Type | Package | Applies |
|---|---|---|
(any) -> any | combinatoricsreplaces compute-engine | always |
(reducer: (unknown, T) any -> unknown, initial: value, collection<T>) -> value where T | compute-engine | always |
Examples
Applications #
Properties #
About
| Examples | 36 |
|---|---|
| Checked against | Wolfram Language 35 agree1 differmathlib4 6 agree1 error |
| Crosswalk | Wolfram Language |
Implementation
mapped
mathlib4packages/oracle/src/mappings.tsA left fold from the seed, as ours, so f(acc, element). The seedless two-argument form is not bound.
See also: Scan