fold

Applies an operator to all elements of an array and accumulates the results during iteration.

Syntax

(fold operator)

Signatures

  1. Type
    (fold op): <<n>>(T1;T2^n; ... ;Tm^n) returns (T1)
    where
    op: (T1;T2; ... ;Tm) returns (T1)
    with T1 the type of the accumulator.

    In this signature, T1 can be extended to a named group where each group field is an accumulator.

  2. Causality

    The resulting operator (fold op) is an operator where each of its outputs depends instantaneously on all of its inputs.

  3. Initialization

    The resulting operator (fold op) has its first value defined if all inputs have their first values defined.

  4. Clock

    The resulting operator (fold op) has the same clock as its inputs and outputs.