sumWith

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

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

Receiver

the collection to sum up.

Return

the sum.

Parameters

group

the algebra that provides addition.


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

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

Receiver

the collection to sum up.

Return

the sum.

Parameters

group

the algebra that provides addition.