sum

trait Collection[A] {
  def sum: A
}

sum computes the sum of the elements of this collection.

On empty collections this function returns the identity element for the sum operation of the type A.