I think you'll be able to achieve this cleanly with Kernel.get_in and Kernel.update_in with Elixir 1.3. I'm sure there's more info somewhere, but this is the extent of my knowledge at this time: https://twitter.com/elixirlang/status/735942800039088129
-Greg > On May 27, 2016, at 6:56 AM, Thijs Klaver <[email protected]> wrote: > > Hello, > > In the same sense as Enum.filter_map/3, Enum.map_join/3, I propose > Enum.find_map/4 (or Enum.find_transform/4). > Right now you would do something like > > foo = > Enum.find list, nil, fn item -> some_check(item) end > |> if(foo, do: foo.bar) > > With Enum.find_map you could do something like this > > foo = Enum.find list, nil, fn item -> some_check(item) end, fn item -> > Map.get item, :bar end > > This way you don't have to check if Enum.find actually found something before > transforming 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/8d31a0c3-1902-480b-aeb7-38182726c884%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/8E2F654A-BB47-4896-87A2-1BE0A8160AD9%40gmail.com. For more options, visit https://groups.google.com/d/optout.
