mergeIterable<I, R> function
Merges all entries of iterable
using merge
function.
init
The initial value of total.
Implementation
R? mergeIterable<I, R>(
Iterable<I> iterable, R Function(R? total, I value) merge,
[R? init]) {
if (iterable.isEmpty) return init;
var total = init;
for (var entry in iterable) {
total = merge(total, entry);
}
return total;
}