Copyright | (c) 2017 Daniel Lovasko |
---|---|
License | BSD2 |
Maintainer | Daniel Lovasko <daniel.lovasko@gmail.com> |
Stability | stable |
Portability | portable |
Safe Haskell | Safe |
Language | Haskell2010 |
- type Range a = (a, a)
- type RangeSet a = [Range a]
- empty :: RangeSet a
- null :: RangeSet a -> Bool
- size :: (Num n, Enum a) => RangeSet a -> n
- fromAscList :: (Ord a, Enum a) => [a] -> RangeSet a
- fromDescList :: (Ord a, Enum a) => [a] -> RangeSet a
- fromList :: (Ord a, Enum a) => [a] -> RangeSet a
- toList :: Enum a => RangeSet a -> [a]
- insertPoint :: (Ord a, Enum a) => a -> RangeSet a -> RangeSet a
- insertRange :: (Ord a, Enum a) => (a, a) -> RangeSet a -> RangeSet a
- removePoint :: (Ord a, Enum a) => a -> RangeSet a -> RangeSet a
- removeRange :: (Ord a, Enum a) => (a, a) -> RangeSet a -> RangeSet a
- queryPoint :: Ord a => a -> RangeSet a -> Bool
- queryRange :: Ord a => (a, a) -> RangeSet a -> Bool
- difference :: (Ord a, Enum a) => RangeSet a -> RangeSet a -> RangeSet a
- intersect :: (Ord a, Enum a) => RangeSet a -> RangeSet a -> RangeSet a
- union :: (Ord a, Enum a) => RangeSet a -> RangeSet a -> RangeSet a
Documentation
Test if the range set does not contain any points.
Count the number of unique points stored in the range set.
Create a range set from a list of ascending points. The list can contain duplicates.
Create a range set from a list of descending points. The list can contain duplicates.
Create a range set from a list of points. The ordering of the points is not important. The list can contain duplicates.
Convert the range set into a list of points.
Insert a single point into the range set.
Insert a range into the range set.
removePoint :: (Ord a, Enum a) => a -> RangeSet a -> RangeSet a Source #
Remove a single point from the range set.
removeRange :: (Ord a, Enum a) => (a, a) -> RangeSet a -> RangeSet a Source #
Remove a range from the range set.
Test whether a point is included in the range set.
Test whether a range is included in the range set.
:: (Ord a, Enum a) | |
=> RangeSet a | first range set |
-> RangeSet a | second range set |
-> RangeSet a | difference of two range sets |
Subtract a range set from another range.