Sorry, but your example does not looks really good …
%{
"some" => %{
"nested" => %{
"path" => [
%{"string-key" => :value2},
%{"string-key" => :value2},
%{"string-key" => :value2}
]
}
}
}
|> get_in(~w[some nested path])
|> Enum.map(&%{atom_key: &1["string-key"]})
- Shorter syntax
- No dependencies
- I guess that the
Elixirlanguage and related hex packages maintained by core team members are as fast as other packages if not faster
Later in the main module’s documentation the Error handling is mentioned, but in this case all we have to do is to change a getter function like:
%{
"some" => %{
"nested" => %{
"path" => [
%{"string-key" => :value2},
%{"string-keyy" => :value2},
%{"string-key" => :value2}
]
}
}
}
|> get_in(~w[some nested path])
|> Enum.map(&%{atom_key: Map.fetch!(&1, "string-key")})
- Do exactly same error handling
- Uses well known
KeyErrorand it’s message Babel.fetch/1is confusing as it does not uses a trailing bang naming convention
So far I did not found anything in documentation which is not handled by Enum, Map, List, Kernel and Access modules.






















