You can get the second element of the tuple:

%{users: [%{name: "John", age: 27}, %{name: "Betty", age: 40}]}
|> pop_in([:users, Access.all(), :age])
|> elem(1)
|> update_in([:users, Access.all(), :name], &String.downcase/1)
# => %{users: [%{name: "john"}, %{name: "betty"}]}

Also, if the answer is “delete isn’t needed because pop_in exists”, then
> why do Map and Keyword provide delete and pop operations? The same
> argument could be made there that delete is unnecessary since they
> provide pop but I’m glad delete is necessary for them and would like it
> for nested structures, too.
>
Because adding a function to a module specific to a data-structure can be
taken lightly compared to adding yet another function to Kernel.

-- 
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/CAGnRm4LjeiJsNOEkRr_c1aoUxiY6mfQM%3DJ3mqE5EVNv1OonTCw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to