sumInt method

int sumInt(
  1. int selector(
    1. T
    )
)

Implementation

int sumInt(int Function(T) selector) {
  return fold(0, (sum, item) => sum + selector(item));
}