I looked at having a fast path for Enum.into when I did the original Map.new
upgrades and we decided against it. When the goal is to create a map from
scratch |> Map.new is the clearest way to write that. The fast path for
Enum.into would require that the second arg is BOTH a map AND an empty map,
otherwise you can't use Map.new. If Enum.into(%{}) were the best way to create
a new map from some other thing it would be worth the extra code path but I see
Map.new as superior for that purpose.
I do agree that documentation in Enum could mention that. I'm inclined to stick
it in the moduledoc though because it applies to conceptually to the whole
module. By way of example, it's just as relevant to filter as it is to map.
--
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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/645bf181-0cbc-4aff-b456-a6cb791f88aa%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.