• Applies the reduction of aFun on the list aList starting from anAcc, and visiting the elements of aList from left to right.

    Parameters

    • aList: List<any>

      the list to consider

    • aFun: ((anAcc: any, aValue: any) => any)

      a function supposed to be written (anAcc, aValue) => aNewAcc

        • (anAcc, aValue): any
        • Parameters

          • anAcc: any
          • aValue: any

          Returns any

    • anAcc: any

      a starting value

    Returns any

    listReduce(cons(1, cons(2, nil)), (anAcc, aValue) => anAcc+aValue, 0); // -> 3 = 1 + 2