Enum.sum_by/2
defmodule Enum do
def sum_by(enumerable, fun)
end
Maps and computes the sum of the given enumerable in one pass.
Raises ArithmeticError if fun returns a non-numeric value.
defmodule Enum do
def sum_by(enumerable, fun)
end
Maps and computes the sum of the given enumerable in one pass.
Raises ArithmeticError if fun returns a non-numeric value.