Hello,

I'd like to propose *Enum.sum/2*, where the second argument is a function.

This will allow writing

Enum.sum([1, 2, 3], &(&1 * 2))

instead of
  
Enum.map([1,2,3], &(&1 * 2)) |> Enum.sum()

The advantages are:

- Write less code.
- One few iteration across the collection.

I have a branch prepared - 
https://github.com/elixir-lang/elixir/compare/master...seanhandley:map_with_func

Please let me know your thoughts.

Cheers,
Sean

-- 
You received this message because you are subscribed to the Google Groups 
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to elixir-lang-core+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/elixir-lang-core/a6cb1e15-f32a-4e27-848d-ac8b80f080c0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to