sum

fun <T> Ring<T>.sum(data: Iterable<T>): T

Returns the sum of all elements in the iterable in this Ring.

Return

the sum.

Parameters

<receiver>

the algebra that provides addition.

data

the iterable to sum up.

fun <T> Ring<T>.sum(data: Sequence<T>): T

Returns the sum of all elements in the sequence in this Ring.

Return

the sum.

Parameters

<receiver>

the algebra that provides addition.

data

the sequence to sum up.