An implementation of compressed integer sets using lists of integer ranges. Operations such as adding and membership are O(n) where n is the number of contigous ranges in the set. For data that is mostly serial, n should remain very small.
Note that when n gets very large, in addition to poor performance, this behavior may throw exceptions since some of the code is not tail-recursive.