cumulative

inline fun <T, R> Iterator<T>.cumulative(initial: R, crossinline operation: (R, T) -> R): Iterator<R>

Generic cumulative operation on iterator.

Parameters

T

the type of initial iterable.

R

the type of resulting iterable.

initial

lazy evaluated.


inline fun <T, R> Iterable<T>.cumulative(initial: R, crossinline operation: (R, T) -> R): Iterable<R>
inline fun <T, R> Sequence<T>.cumulative(initial: R, crossinline operation: (R, T) -> R): Sequence<R>
inline fun <T, R> List<T>.cumulative(initial: R, crossinline operation: (R, T) -> R): List<R>