sumWith

fun <T> Iterable<T>.sumWith(space: Space<T>): T

Returns the sum of all elements in the iterable in provided space.

Return

the sum.

Parameters

<receiver>

the collection to sum up.

space

the algebra that provides addition.

fun <T> Sequence<T>.sumWith(space: Space<T>): T

Returns the sum of all elements in the sequence in provided space.

Return

the sum.

Parameters

<receiver>

the collection to sum up.

space

the algebra that provides addition.