sum method

double sum(
  1. DoubleSelector selector
)

Implementation

double sum(DoubleSelector selector) =>
    fold(0.0, (previousValue, element) => previousValue + selector(element));