sum method

E sum()

Returns the sum of all elements in the collection.

The iterable must have at least one element.

Implementation

E sum() => (this ?? Iterable.empty()).reduce(add);