sumWith

fun <T> Iterable<T>.sumWith(group: Ring<T>): T

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

Return

the sum.

Parameters

<receiver>

the collection to sum up.

group

the algebra that provides addition.

fun <T> Sequence<T>.sumWith(group: Ring<T>): T

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

Return

the sum.

Parameters

<receiver>

the collection to sum up.

group

the algebra that provides addition.