Reduction over one-dimensional arrays
The reduction of a function over a one-dimensional array is written as:
For array literals, it is implemented in Pharo:
Example
Uses
The sum of an integer array is obtained as
with
Reduction over an array with a single element is a valid edge case:
Reduction over an empty array is not defined: