public function sum(callable $function = null) { $sum = null; foreach ($this->mapIterator($function) as $value) { $sum += $value; } return $sum; }