Applies the reduction of aFun on the list aList starting from anAcc, and visiting the elements of aList from right to left. This function is not implemented in a tail-recursive manner for simplicity.
aFun
aList
anAcc
the list to consider
a function supposed to be written (anAcc, aValue) => aNewAcc
a starting value
listReduceRight(cons(1, cons(2, nil)), (anAcc, aValue) => anAcc+aValue, 0); // -> 3 = 0 + 2 + 1 Copy
listReduceRight(cons(1, cons(2, nil)), (anAcc, aValue) => anAcc+aValue, 0); // -> 3 = 0 + 2 + 1
Applies the reduction of
aFunon the listaListstarting fromanAcc, and visiting the elements ofaListfrom right to left. This function is not implemented in a tail-recursive manner for simplicity.