[elixir-core:11643] [Proposal] Add Enum.select as alias for Enum.filter

2024-02-02 Thread Michael Neumann
Hi, I am proposing to add Enum.select as an alias for Enum.filter. Why? In my native language (German), when we talk about "filtering", its exact meaning can be context dependent: - Water filter - Filters substances out of unclean water. (rejects all but water) - Particle filter - Rejects part

Re: [elixir-core:11648] [Proposal] Add Enum.select as alias for Enum.filter

2024-02-03 Thread Michael Neumann
resting is that Javascript doesn’t have select or reject, but > only filter. > Filter actually works exactly like you say it does in language (both > German and English) > > = Enum.filter(& &1 == ) > = Enum.filter(& &1 != ) > > Just an observation > >

Re: [elixir-core:11650] [Proposal] Add Enum.select as alias for Enum.filter

2024-02-03 Thread Michael Neumann
imberlake.com> wrote: > >> I doubt an alias will be accepted. >> >> What’s interesting is that Javascript doesn’t have select or reject, but >> only filter. >> Filter actually works exactly like you say it does in language (both >> German and English) >> >

Re: [elixir-core:11651] [Proposal] Add Enum.select as alias for Enum.filter

2024-02-03 Thread Michael Neumann
as a library called filter (https://pkg.go.dev/robpike.io/filter) that uses Choose. IMHO, good name :) On Sun, Feb 4, 2024 at 3:40 AM Austin Ziegler wrote: > On Sat, Feb 3, 2024 at 8:58 PM Michael Neumann > wrote: > >> IMHO, filter is a bad naming for what it does when coupled w

Re: [elixir-core:11879] Re: Short form of lambdas for zero arguments and unused arguments proposal

2024-08-24 Thread Michael Neumann
Hi, You could use a function that manipulates your function: def shift_args(f), do: fn _x, y -> f(y) end Now, with that, your proposed: &(&2 + 1) becomes shift_args(&(&1 + 1)) This is just food for thought. In my opinion, it's often better to just resort to good old functions: fn _, x -> x