6.12.2 Interval Sets

An interval set holds a collection of intervals, with automatic merging of overlapping and abutting intervals. The domain need not be numeric, but does need to be totally ordered (for instance, you could use strings compared lexicographically). An interval has a lower and upper bound and can be open or closed at either end (all four possibilities are supported). Union, intersection, and set-difference operations are available.

I never used this, though I once thought I was going to; it should be considered untested.