Hi Anastasiya, I like the proposal. A PR will be appreciated, thank you!
On Fri, Mar 19, 2021 at 8:29 PM Anastasiya Dyachenko <[email protected]>
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 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,
> fn {_, v_a} = a, {_, v_b} = b ->
> if v_a >= v_b, do: a, else: b
> end
> )
> => [a: 2]
>
> --
> You received this message because you are subscribed to the Google Groups
> "elixir-lang-core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/elixir-lang-core/b0e4b7f1-0a8f-406c-89d2-84b51edb500bn%40googlegroups.com
> <https://groups.google.com/d/msgid/elixir-lang-core/b0e4b7f1-0a8f-406c-89d2-84b51edb500bn%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
>
--
You received this message because you are subscribed to the Google Groups
"elixir-lang-core" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/elixir-lang-core/CAGnRm4%2B%2BtH0WfYPBhozH8eQKxj1m%3DciV78jaL3AgEi9BjXN4bg%40mail.gmail.com.