Box
Abstract immutable data type that represents an interval over parameter T. In general, to define an interval over a set, we only need a total ordering relation defined over that set. For this reason, I am requiring Intervals to be defined over a type T that implements a Comparable interface (of any extension of that). The Comparable interface is slightly stricter than the previous interval definition, as it also requires some (integer) metric to assess the distance between the objects compared. However, I believe this seems coherent with the approach adopted by Moonlight, and being implemented by all numeric types, it provides a fairly general support out of the box. For the reason why Box implements Comparable itself, see compareTo.