sum

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

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

Return

the sum.

Parameters

<receiver>

the algebra that provides addition.

data

the iterable to sum up.

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

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

Return

the sum.

Parameters

<receiver>

the algebra that provides addition.

data

the sequence to sum up.