Applies the reduction of aFun on the list aList starting from anAcc, and visiting the elements of aList from left to right.
aFun
aList
anAcc
the list to consider
a function supposed to be written (anAcc, aValue) => aNewAcc
a starting value
listReduce(cons(1, cons(2, nil)), (anAcc, aValue) => anAcc+aValue, 0); // -> 3 = 1 + 2 Copy
listReduce(cons(1, cons(2, nil)), (anAcc, aValue) => anAcc+aValue, 0); // -> 3 = 1 + 2
Applies the reduction of
aFunon the listaListstarting fromanAcc, and visiting the elements ofaListfrom left to right.