My knowledge of Scala is not extensive, but by doing some tests, I get the following:
scala> Set(1,2) < <console>:5: error: missing arguments for method < in trait Ordered; follow this method with `_' if you want to treat it as a partially applied function Set(1,2) < ^
This tells me that < comes from the Ordered attribute. Additional tips:
scala> Set(1,2) < _ res4: (Iterable[Int]) => Boolean = <function>
That is, Set evaluates to Iterable because there may be some implicit conversion from Iterable [A] to Ordered [Iterable [A]], but I'm not sure anymore ... Tests are incompatible. For example, these two may offer a kind of lexicographic comparison:
scala> Set(1,2,3) < Set(1,2,4) res5: Boolean = true
1 equals, 2 equals, 3 is less than 4.
scala> Set(1,2,4) < Set(1,2,3) res6: Boolean = false
But this is not so:
scala> Set(2,1) < Set(2,4) res11: Boolean = true scala> Set(2,1) < Set(2,2) res12: Boolean = false
I think the correct answer is that it is found in the Ordered : there is no implementation for < between sets more than comparing their hashCode:
It is important that the hashCode method for an instance of Ordered [A] is compatible with the comparison method. However, it is not possible to provide a reasonable default implementation. Therefore, if you need to calculate the hash of an Ordered [A] instance, you must provide it yourself either during installation or when creating the instance.