I like this idea. I think it is a good addition. Using `get_in`, it is 
impossible to tell if the key exists, but with `nil` as value, or of it 
doesn't exist.

On Monday, August 29, 2016 at 1:11:29 PM UTC+2, Brian Cardarella wrote:
>
> When using `with` there are several times I wish I could have reached 
> deeper into a Map or Keyword list in a single line rather than multiple 
> fetch statements. Ideally it would work like this:
>
> ```
> map = %{foo: %{bar: "baz"}}
>
> %{:ok, "bar"} = fetch_in(map, [:foo, :bar])
> :error = fetch_in(map, [:foo, :qux])
> :error = fetch_in(map, [:bar])
> ```
>
> If this is OK I can implement it.
>

-- 
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/b87842df-23f0-421a-95b3-0e7b793cb09a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to