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
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
>
>
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)
>>
>
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
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