cats
cats copied to clipboard
Proposal: merge `cats-time` into `cats`
cats-time is a microlibrary that implements instances of kernel typeclasses, such as Show, Ord, Eq, or Hash, for the classes of the java.time package. This package was introduced in version 8.0 of the JDK, in order to replace previous unsatisfactory classes (such as java.Date), and was derived from joda-time.
The proposal is that these files be merged into the kernel package, and the cats-time library archived.
Some considerations on this matter are as follows:
- Precedent: there is a trait of instances for
java.util.UUIDalready inkernel. java.timeis just as standard a library asOption,Either, so it is reasonable to also include its instances in the package.- Adding instances for a JDK-specific class would add a coupling between
catsand the JVM platform specifically, but as mentioned that already happens withjava.util.UUID. - This would make the
catskernel incompatible with JDK pre-8 versions. The existing instance forUUIDonly adds incompatibility with pre-1.5 JDKs. Note that JDK 8 was released in March 2014, almost seven years ago, so I am not sure how farcatsretrocompatibility should go.
Since cats already requires Java 8+ as of version 2.1.0 because it's only published for Scala 2.12+, I think this proposal is very sensible
The only major concern here would be around ScalaJS support.
The only major concern here would be around ScalaJS support.
In other projects there is a separation of sources that are JS-specific or JVM-specific. Perhaps we can do the same here?
As noted, this already happens with UUID.
Strong :+1:. We shouldn't accept a lesser experience on our flagship platform when a feature is not supported by a secondary platform. And for the Java 8 requirement, public support for Java 7 ended in 2015.
Taking existing support into account, I have opened PR to integrate this into the cats.kernel...