-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Range set -- -- Data structure that stores a set of ranges. It provides an API similar -- to the Data.Set module. Types stored in the data structure have to be -- instances of Eq, Ord and Enum typeclasses. @package rset @version 1.0.0 module Data.Set.Range -- | A simple range, denoted by the low and high boundaries. type Range a = (a, a) -- | A set of ranges type RangeSet a = [Range a] -- | Create an empty range set. empty :: RangeSet a -- | Test if the range set does not contain any points. null :: RangeSet a -> Bool -- | Count the number of unique points stored in the range set. size :: (Num n, Enum a) => RangeSet a -> n -- | Create a range set from a list of ascending points. The list can -- contain duplicates. fromAscList :: (Ord a, Enum a) => [a] -> RangeSet a -- | Create a range set from a list of descending points. The list can -- contain duplicates. fromDescList :: (Ord a, Enum a) => [a] -> RangeSet a -- | Create a range set from a list of points. The ordering of the points -- is not important. The list can contain duplicates. fromList :: (Ord a, Enum a) => [a] -> RangeSet a -- | Convert the range set into a list of points. toList :: Enum a => RangeSet a -> [a] -- | Insert a single point into the range set. insertPoint :: (Ord a, Enum a) => a -> RangeSet a -> RangeSet a -- | Insert a range into the range set. insertRange :: (Ord a, Enum a) => (a, a) -> RangeSet a -> RangeSet a -- | Remove a single point from the range set. removePoint :: (Ord a, Enum a) => a -> RangeSet a -> RangeSet a -- | Remove a range from the range set. removeRange :: (Ord a, Enum a) => (a, a) -> RangeSet a -> RangeSet a -- | Test whether a point is included in the range set. queryPoint :: Ord a => a -> RangeSet a -> Bool -- | Test whether a range is included in the range set. queryRange :: Ord a => (a, a) -> RangeSet a -> Bool -- | Subtract a range set from another range. difference :: (Ord a, Enum a) => RangeSet a -> RangeSet a -> RangeSet a -- | Create an intersection of two range sets. intersect :: (Ord a, Enum a) => RangeSet a -> RangeSet a -> RangeSet a -- | Create an union of two range sets. union :: (Ord a, Enum a) => RangeSet a -> RangeSet a -> RangeSet a