One small amendment, in the successful case, I think `fetch_in` should return a tuple instead of a map. Allen Madsen http://www.allenmadsen.com
On Mon, Aug 29, 2016 at 8:19 AM, Allen Madsen <[email protected]> wrote: > +1 from me. Seems consistent with `get_in` and `put_in` and follows > the semantics of `fetch`. > Allen Madsen > http://www.allenmadsen.com > > > On Mon, Aug 29, 2016 at 7:11 AM, Brian Cardarella <[email protected]> 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/7daf519b-6122-4aeb-a8bd-7115625f28a9%40googlegroups.com. >> For more options, visit https://groups.google.com/d/optout. -- 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/CAK-y3CvrGzW7K9uGPqa9_tufkj%3DcspLYtHOngJTnyg4pKaHa%3DQ%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
