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.
Classes that support algebraic structures with dynamic switching between two representations, the original type O and the eventual type E. In the case of Semigroup, we specify
Left(x+y) Left(x) + Right(y)
Right(y) = Left(convert(x+y)) if mustConvert(x+y) Right(x+y) otherwise. EventuallyMonoid, EventuallyGroup, and EventuallyRing are defined analogously, with the contract that convert respect the appropriate structure.