Initial Problem:
In Scala, I would like to use implicit Ordering[T]#Ops
to compare two LocalDate
.
It just to use "operators" like >
instead of isAfter
.
It should be just an import: import scala.math.Ordering.Implicits._
Inspection:
Looks like it works with LocalTime
and doesn't with LocalDate
because LocalTime
instead of LocalDate
implements Comparable<LocalTime>
.
Question:
I wondering,
Why LocalDate
implements Comparable<ChronoLocalDate>
instead of Comparable<LocalDate>
?
Comparable<ChronoLocalDate>
as well asChronoLocalDate
and by implementing those two, every instance of it is of course comparable to anotherLocalDate
instance. – AgostoLocalDate
– Zincography