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
Note that this works similar to Semigroup[Map[Int,T]] not like Semigroup[List[T]] This does element-wise operations, like standard vector math, not concatenation, like Semigroup[String] or Semigroup[List[T]]
If l.size != r.size, then only sums the elements up to the index min(l.size, r.size); appends the remainder to the result.