reduction

inline fun <T, R> Iterable<T>.reduction(initial: R, operation: (acc: R, T) -> R): List<R>

Creates reduction of the given Iterable. This function can be used for example for cumulative sums.

Iterable.reduce does not allow you to set initial value.

Sources

Link copied to clipboard