Returns an instance of T
calculated by summing all instances in
iter
in one pass.
Returns an instance of T
calculated by summing all instances in
iter
in one pass. Returns None
if iter
is empty, else
Some[T]
.
instances of T
to be combined
None
if iter
is empty, else an option value containing the summed T
Override if there is a faster way to compute this sum than
iter.reduceLeftOption
using plus.
A semigroup is any type
T
with an associative operation (plus
):Example instances:
Semigroup[Int]
:plus
Int#+
Semigroup[List[T]]
:plus
isList#++