[elixir-core:11707] [Proposal] Adding Access.find/1

2024-03-19 Thread 'oliver....@googlemail.com' via elixir-lang-core
Hi. I already made a PR but was redirected here. ;-) This new function Access.find/1 would basically work like Enum.find/2 but for get_in/2 and similar functions. It can be used for scenarios like: - Popping the first found element. - Updating only the first found match in a list. - To get_in/2

Re: [elixir-core:11710] [Proposal] Adding Access.find/1

2024-03-20 Thread 'oliver....@googlemail.com' via elixir-lang-core
um.find` is to > `Enum.filter`. > I think it would be a nice addition as it can express operations that > would be quite verbose otherwise. > > Le mer. 20 mars 2024 à 02:30, 'oliver@googlemail.com' via > elixir-lang-core a écrit : > > Hi. > > I already

Re: [elixir-core:11712] [Proposal] Adding Access.find/1

2024-03-20 Thread 'oliver....@googlemail.com' via elixir-lang-core
at 11:40:15 AM UTC+1 José Valim wrote: > Can you please provide a link to the previous discussions? I recall > dealing with some complexities around finding and not finding elements as > well. Thanks! > > On Wed, Mar 20, 2024 at 11:37 AM 'oliver@googlemail.com' via >

Re: [elixir-core:11714] [Proposal] Adding Access.find/1

2024-03-20 Thread 'oliver....@googlemail.com' via elixir-lang-core
find!` in the future to mirror `at!` as well. > > On Wed, Mar 20, 2024 at 12:00 PM 'oliver....@googlemail.com' via > elixir-lang-core wrote: > >> This is what I found: >> >> From the original PR: https://github.com/elixir-lang/elixir/pull/6634 >>

Re: [elixir-core:11715] Why no ternary expression?

2024-03-20 Thread 'oliver....@googlemail.com' via elixir-lang-core
&(&1) ... sigh. In the project where I work I generally argue against these constructs because it really reduces readability. There's a limit of special character the brain can process correctly in a row. (My personal opinion, though.) In general, two constructs are more common in our code: i