> José, would you be open to the addition of a Map.new!/2 function that
> raises an error when there are duplicate keys? Although, maybe that implies
> that Map.new/2 returns {:ok, map} (which is obviously doesn’t).
>
I am not convinced this is an extremely common use case to justify its
addition to the standard library. Especially one that can be implemented in
few lines of code.

>  I was hoping we could at least detect this situation (but not necessarily
> detect what the duplicate keys are) in constant time by using map_size/1
> on the resulting map, and comparing it to the input size.
>
The input size is an enumerable and it is not guaranteed we can retrieve
its size in constant time. The most common input is a list and it would
require at least traversing the list one more time.

-- 
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/CAGnRm4%2B6__DcCdEpArNQPMyVri3HYKe%2BTw%2BT3kUxuY5sRrDSSg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to