Just to throw some cents in her.. I think, it belongs into a library, like
in other languages.
The elixir core, is mostly used to build the elixir core itself and make it
*extendable*.
Just imagine this example
Map.invert(%{foo: %{ what: :jo }})
%{%{jo: :what} => :foo}) ?
Or
%{%{what: :jo}
One discussion is about inclusion in core (settled), and a different
discussion is about semantics.
The point of invert is: when you as a programmer know the mapping is a
bijection, and you need boths directions, you know invert is well-defined
and can use it (present in some languages). If the
First of all, I really think that 'invert' is very unfortunate name for such an
operation. I was very surprised with the proposed semantic, which for me looks
more like 'transpose' (remember matrix transpose).
But even with that name the operation is possible to lose data if values are
not