Synopsis Apply a function to successive elements of list and combine the results (deprecated).
Function &T reducer(list[&T] lst, &T (&T, &T) fn, &T unit)
Usage import List;
Description Apply the function fn to successive elements of list lst starting with unit.
rascal>import List;
rascal>int add(int x, int y) { return x + y; }
int (int, int): int add(int, int);
rascal>reducer([10, 20, 30, 40], add, 0); 
int: 100
Pitfalls This function is deprecated, use a Reducer instead.
Is this page unclear, or have you spotted an error? Please add a comment below and help us to improve it. For all other questions and remarks, visit