Arbeit kann ich Methode Arbeit bis Tuple9 erhalten vergleichen wie folgt vor:Scala Tuple10 implizite Ordnung nicht
import scala.math.Ordered.orderingToOrdered
(1,2,"ab",4,5,6.0,7l,"de",1.0) compare (1,2,"ab",4,5,6.0,7l,"de",1.0)
Aber mit Tuple10 bekomme ich kompilieren Fehler:
import scala.math.Ordered.orderingToOrdered
(1,2,"ab",4,5,6.0,7l,"de",1.0,2) compare (1,2,"ab",4,5,6.0,7l,"de",1.0,2) // >> compile error: value compare is not a member of (Int, Int, String, Int, Int, Double, Long, String, Double, Int)
ich alternative Art und Weise versucht, aber das gibt auch impliziter Fehler:
implicitly[Ordering[Tuple10[Int, Int, String, Int, Int, Double, Long, String, Double, Double]]].compare((1,2,"ab",4,5,6.0,7l,"de",1.0,4), (1,2,"ab",4,5,6.0,7l,"de",1.0,4))
compiler error:
No implicit Ordering defined for (Int, Int, String, Int, Int, Double, Long, String, Double, Double).
not enough arguments for method implicitly: (implicit e: Ordering[(Int, Int, String, Int, Int, Double, Long, String, Double, Double)])Ordering[(Int, Int, String, Int, Int, Double, Long, String, Double, Double)]. Unspecified value parameter e.
Sieht aus wie Bestellung für nur bis Tuple9 definiert ist. Korrigiere mich, wenn ich falsch liege.
danke. Was wäre der beste Ort, um eine solche Erweiterung hinzuzufügen? Ich weiß in einem Umfang, was verfügbar ist, aber um es globaler zu machen, ist es besser, es in ein Utility-Objekt zu legen und Importe von implizit zu machen? – nir