Partially sorting collections in Scala询问如何用Scala中的PartialOrdering进行排序。评论指出作者不应该在给出的例子中进行部分排序。 I 做需要通过偏序排序 - 我有可能是其他国家的飞地的国家,这导致了部分排序。 因此:给定List[T],其中T延伸PartialOrdering[T],是否有根据偏序排序的明智方法?
我试图解决以下几点: val temp1 = (3, "hello")
val temp2 = (2, "abcde")
temp1 <= temp2
返回错误 <console>:24: error: value <= is not a member of (Int, String)
temp1 <= temp2
^
我试着加入以下到我的代码: imp