Re: [elixir-core:9063] Re: Function.pipe_to/2

2019-08-15 Thread Khaja Minhajuddin
I definitely see the value of having a new function which helps with piping into anonymous functions. I vote for `Function.into`, it reads nicely and doesn't have the confusion of `pipe_to`. On Tuesday, August 13, 2019 at 12:12:13 PM UTC-4, José Valim wrote: > > I have just asked to keep this th

Re: [elixir-core:9061] [Proposal] Map.filter/2 based on :maps.filter

2019-08-15 Thread Andrea Leopardi
We should also address the fact that if we add Map.filter/2, we also likely have to add Map.drop/2 (to mimic Enum and Stream), but that name is already taken. On Thu, 15 Aug 2019 at 12:26, Johanna Larsson wrote: > The stream version is by far the slowest, which isn't surprising since > streams b

Re: [elixir-core:9060] [Proposal] Map.filter/2 based on :maps.filter

2019-08-15 Thread Johanna Larsson
The stream version is by far the slowest, which isn't surprising since streams bring some overhead. Didn't measure memory usage though https://gist.github.com/joladev/2b51260107078a1fc7f9d4504916fe21 Honestly, I tend to agree it would be nice to add it, for feature completeness, even if it doesn't

Re: [elixir-core:9060] Proposal: standardize expression to refer to functions with multiple arities (and ExDoc auto-linking)

2019-08-15 Thread Fernando Tapia Rico
Thanks everyone for your feedback! I think everybody is ok with `fun/1,2`, so let's make it official! I've created issues in: ExDoc: https://github.com/elixir-lang/ex_doc/issues/1079 Elixir: https://github.com/elixir-lang/elixir/issues/9295 On Tuesday, August 13, 2019 at 1:16:45 PM UTC+2, Sven

Re: [elixir-core:9058] [Proposal] Map.filter/2 based on :maps.filter

2019-08-15 Thread Alexei Sholik
The simplest alternative is to use :maps.filter(). It's not as easy to pipe into, but that's a minor concern for me. As another alternative, this should be faster and have lower memory footprint than using Enum, although you'd need to benchmark it as well to be sure: map |> Stream.filter(predicat

[elixir-core:9058] [Proposal] Map.filter/2 based on :maps.filter

2019-08-15 Thread Roman Smirnov
Since OTP 18 there is a pretty convenient function :maps.filter . I think it would be nice to have Map.filter(map, predicate) in Elixir as well instead of doing map|> Enum.filter(predicate)|> Enum.into(%{}) or for {key, value} <- map, some_filt