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.

Reply via email to