A slightly less trivial implementation of range sets.
This is nearly identical to Data.RangeSet.List
except for some
important performance differences:
- Most query functions in this module are O(log n) rather
than O(n), so may be much faster.
- Most composition functions have the same time complexity but a
higher constant, so may be somewhat slower.
If you're mainly calling member
, you should consider using this
module, but if you're calling union
other range manipulation functions as often as querying, you might
stick with the list implementation.
This module is intended to be imported qualified, to avoid name
clashes with Prelude functions, e.g.
import Data.RangeSet.Map (RSet)
import qualified Data.RangeSet.Map as RSet
The implementation of RSet
is based on Data.Map.Strict