[elixir-core:8904] Re: [Notions] extend function capture syntax

2019-07-02 Thread Roman Smirnov
Seems you would like to have currying in Elixir. It's not possible in general way on BEAM, but I had fun with doing it some years ago: https://github.com/romul/utils/blob/master/lib/utils/functions.ex#L49 So, you could use it like Enum.map(rcarry(&Tuple.append/2, 42)) вторник, 2 июля 2019 г., 19

[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

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

2019-08-17 Thread Roman Smirnov
) end) > > Such an extension is unlikely to be added though because it would be > another way of doing what is already possible with Enum, Stream, and Map. > > On Thu, Aug 15, 2019 at 10:29 AM Roman Smirnov > wrote: > >> Since OTP 18 there is a pretty convenient functi

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

2019-08-17 Thread Roman Smirnov
; allow filtering the first argument in addition to the currently supported >>> transformation. So instead of the current >>> >>> Map.new(enumerable, fn thing -> {key, val} end) >>> >>> we could have >>> >>> Map.new(enumerable, map: fn thing

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

2019-08-18 Thread Roman Smirnov
etely different things. > > My bad, I was referring to Enum.reject/2! > > Andrea Leopardi > an.le...@gmail.com > > > On Sat, Aug 17, 2019 at 11:42 PM Roman Smirnov > wrote: > >> Why? How Enum.drop/2 is related to Enum.filter/2? They are doing >> completely