Something that came to mind early this morning, is that in the way it is 
currently defined, the following two things are *not* equal:

collection
|> Enum.sort(&some_fun/2)
|> Enum.reverse

collection
|> Enum.reverse_sort(&some_fun/2)

The difference arises because of sorting stability: Assuming a stable 
comparison function, `Enum.sort` is stable. This means that in the first 
example, elements that are equal end up in the reverse order from their 
original order.

Because this difference in behaviour might be surprising, maybe we should 
indeed find a different name for `Enum.reverse_sort`.


-- 
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/bb66639f-6feb-4eef-8db9-35a8f65e471f%40googlegroups.com.

Reply via email to