@hackage range-set-list0.1.0.0

Memory efficient sets with continuous ranges of elements.

range-set-list

Build Status

A trivial implementation of range sets.

You can find the package (and it's documentation) on hackage.

This module is intended to be imported qualified, to avoid name clashes with Prelude functions, e.g.

import Data.RangeSet.List (RSet)
import qualified Data.RangeSet.List as RSet

The implementation of RSet is based on list.

Compared to Data.Set, this module imposes also Enum restriction for many functions. We must be able to identify consecutive elements to be able to glue and split ranges properly.

The implementation assumes that

x < succ x
pred x < x

and there aren't elements in between (not true for Float and Double). Also succ and pred are never called for largest or smallest value respectively.