sumIterable<I, R> function

num sumIterable<I, R>(
  1. Iterable<num> iterable, {
  2. num init = 0,
})

Uses mergeIterable to sum all iterable values.

Implementation

num sumIterable<I, R>(Iterable<num> iterable, {num init = 0}) =>
    mergeIterable(iterable, (num? total, num value) => total! + value, init)!;