- About Scala
- In the Enterprise
- Scala Community
- Language Research
- In the Press
- The Scala Team
- Scala's Prehistory
- Contact Us
- Learning Scala
- Tour of Scala
- Scala API
- Setup & Getting Started
- Programming Guides
- Other Guides
- Code Examples
- Scala Developers
Missing concept in Scala standard library: Intervals?
Wed, 2011-10-19, 23:17
Are Intervals sufficiently common to add to the standard scala library?
For an ordered type T, we can define an Interval[T].
* It has two ends, which might be open (unbounded) or closed (bounded
at a value).
* Closed bounds might be inclusive or exclusive of the bound
Ranges can be used as intervals. We can test whether objects are
within the interval. We can find the union and intersection of
intervals. Similar to
http://en.wikipedia.org/wiki/Interval_(mathematics) but extending
beyond numbers to other ordered objects.
Widely useful? (I think so, given that Im raising the topic)