continuum
continuum copied to clipboard
intervals and interval sets for Scala
Would be terrific to have this library support Scala 2.13! Scala 2.13 had a substantial revamp of collections library. I tried to fork the code and make it support Scala...
This is an awesome small library, it's unfortunate that it's not available on public maven/ivy repositories. Please consider publishing it on [Maven Central](http://central.sonatype.org/) or similar public repo.
It would help if Interval and IntervalSet implement serializeable, this would be useful for Spark projects.
Scala 2.12 is out, so it's a good idea to support it. Please take a look at https://github.com/swaldman/continuum/commit/bd518e48ed395aa2c1332c33d5d984b6a324f5f7
This library seems to cross-compile cleanly to Scala 2.10.6, 2.11.8, 2.12.1. (I had to upgrade the scalacheck version to one that supports 2.12.x) Tests pass for all three targets.
scala> IntervalSet(Interval.closedOpen(1, 10)) intersects Interval.closedOpen(2,10) java.util.NoSuchElementException: empty map at scala.collection.immutable.RedBlackTree$.smallest(RedBlackTree.scala:84) at scala.collection.immutable.IntervalSet.head(IntervalSet.scala:44) at scala.collection.immutable.IntervalSet.intersects(IntervalSet.scala:144) ... 43 elided