You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea of an interval is central to a large portion of programming logic.
Please consider defining a bounded or half-open interval type in the core Scala lib. Currently, the choices are
Use a tuple (n1, n2). The intent isn't clear and there's no enforcement of invariants that n needs to be ordered and n1 < n2.
Use a library like Spire or Continuuum. This is a heavy dependency bringing a lot of baggage if all you wanted was to express simple business logic like eg "Item count must be between 1 and 5".
Note that Range is a distinct if related idea; an enumerable sequence of integers. Intervals can be defined over a wider set of types, and need not be enumerable.
The text was updated successfully, but these errors were encountered:
The idea of an interval is central to a large portion of programming logic.
Please consider defining a bounded or half-open interval type in the core Scala lib. Currently, the choices are
(n1, n2)
. The intent isn't clear and there's no enforcement of invariants thatn
needs to be ordered and n1 < n2.Note that
Range
is a distinct if related idea; an enumerable sequence of integers. Intervals can be defined over a wider set of types, and need not be enumerable.The text was updated successfully, but these errors were encountered: