According to the documentation, Ord
is a total order. That also makes sense to me, because it will always compare an element to another element as either being smaller or greater, unless it is equal.
Isn't a weak order the same as a total order if we simply put all non-comparable items in the same equivalence class? Maybe these two are actually the same and it's just a semantic difference?
Now I'm confused
But I just noticed that a "total order" indeed depends on how equality is defined (or a used equivalence relation). And the Ord
trait does require that equality (or a certain equivalence relation defined through Eq
) does behave in a certain way.
Yes, Eq
could be any equivalence relation.
Now the question is⦠Is the equality / non-equality operator here an arbitrary equivalence relation? I would say yes, because we're not operating with numbers or any particular objects here in the mathematical definition. If yes, then I'd say Ord
can be seen as "total order".
My point is: Ord
interacts with Eq
, and thus I'd say it's correct to describe it as total order.