I propose the support of Map.take_in/2 to extract values using nested keys (recursively).
I think it may be useful when you only want a part of the map -- mostly when its deep nested map (i.e KV stores, DB engines, etc..) to reduce memory footprint with copy and message passing.
Example:
iex> Map.take_in(%{a: "hello", b: %{c: "hi", d: "hola"}}, [:a, b: [:d]])
%{a: "hello", b: %{d: "hola"}}
As discussed in the #1029 the feature should be extended to Access for both Map and Keyword implementation.
To analyse the efficiency regarding pattern matching.
But it's a way to resolve the duplication from pattern matching as in this example.
iex> %{a: a, b: %{d: d}} = %{a: "hello", b: %{c: "hi", d: "hola"}}
iex> %{a: a, b: %{d: d}}
%{a: "hello", b: %{d: "hola"}}
Thanks :)