Reduces the list to a single value by applying the given function to each element, accumulating the result from the initial value.
Example:
var list = new ArrayList<string> (GLib.str_equal);
list.add ("a");
list.add ("b");
list.add ("c");
var joined = list.reduce<string> ("", (acc, s) => {
return acc + s;
});
assert (joined == "abc");
| initial |
the initial accumulator value. |
| func |
the reduction function. |
|
the final accumulated value. |