Re: [elixir-core:10127] Enum.uniq_by/3 with 3rd arg - a function that decides which value to keep

2021-03-20 Thread José Valim
Hi Anastasiya, I like the proposal. A PR will be appreciated, thank you! On Fri, Mar 19, 2021 at 8:29 PM Anastasiya Dyachenko wrote: > Hi! I'd like to propose adding a 3rd optional argument to Enum.uniq_by > function, which will decide which one of the duplicated values should be > kept. This fu

[elixir-core:10127] Enum.uniq_by/3 with 3rd arg - a function that decides which value to keep

2021-03-19 Thread Anastasiya Dyachenko
Hi! I'd like to propose adding a 3rd optional argument to Enum.uniq_by function, which will decide which one of the duplicated values should be kept. This function will accept 2 values and return one of them, that should be kept. Example: Enum.uniq_by( [a: 1, a: 2], fn {k, v} -> k end,