The law is: next(t) .map { n => partialOrdering.lteq(t, n) && (!partialOrdering.equiv(t, n)) } .getOrElse(true)
The law is: next(t) .map { n => partialOrdering.lteq(t, n) && (!partialOrdering.equiv(t, n)) } .getOrElse(true)
Note Ordering extends PartialOrdering, so we are taking a weak constraint that some items can be ordered, and namely, the sequence of items returned by next is strictly increasing
This is a typeclass to represent things which increase. Note that it is important that a value after being incremented is always larger than it was before. Note that next returns Option because this class comes with the notion of the "greatest" key, which is None. Ints, for example, will cycle if next(java.lang.Integer.MAX_VALUE) is called, therefore we need a notion of what happens when we hit the bounds at which our ordering is violating. This is also useful for closed sets which have a fixed progression.