scan<R> method
List of initial and each step of combine(acc, element).
Implementation
List<R> scan<R>(R initial, R Function(R, T) combine) {
final List<R> out = <R>[initial];
R acc = initial;
for (final T e in this) {
acc = combine(acc, e);
out.add(acc);
}
return out;
}