Skip to content

Reduce

Name Mandatory Description Default Type
⬅️ Input The sequence to fold. [Any]
Output ➡️ The resulting value after folding the sequence. Any
Apply No The function to apply to each item of the sequence. none Shard[Shard]
Initial No The initial value of the accumulator. If not provided the shard will fail if the input sequence is empty. none AnyVar(Any)

Folds a sequence into a single value by applying an operation (specified in the Apply parameter) to each item of the sequence. The operation can transform the type. Note that this shard is able to use the $0 internal variable for the accumulated value and $i for the current index.