License | BSD-3-Clause |
---|---|
Maintainer | Jamie Willis |
Stability | stable |
Safe Haskell | Safe |
Language | Haskell2010 |
This module contains the implementation of an efficient set for contiguous data. It has a much
smaller memory footprint than a Set
, and can result in asymptotically faster operations.
Since: 0.0.1.0
Synopsis
- data RangeSet a
- module Data.RangeSet.Primitives
- singleton :: Enum a => a -> RangeSet a
- null :: RangeSet a -> Bool
- full :: forall a. (Enum a, Bounded a) => RangeSet a -> Bool
- isSingle :: RangeSet a -> Bool
- extractSingle :: Enum a => RangeSet a -> Maybe a
- size :: RangeSet a -> Int
- sizeRanges :: RangeSet a -> Int
- notMember :: Enum a => a -> RangeSet a -> Bool
- findMin :: Enum a => RangeSet a -> Maybe a
- findMax :: Enum a => RangeSet a -> Maybe a
- module Data.RangeSet.SetCrossSet
- complement :: forall a. (Bounded a, Enum a) => RangeSet a -> RangeSet a
- isSubsetOf :: RangeSet a -> RangeSet a -> Bool
- isProperSubsetOf :: RangeSet a -> RangeSet a -> Bool
- allLess :: Enum a => a -> RangeSet a -> RangeSet a
- allMore :: Enum a => a -> RangeSet a -> RangeSet a
- elems :: Enum a => RangeSet a -> [a]
- unelems :: forall a. (Bounded a, Enum a) => RangeSet a -> [a]
- module Data.RangeSet.Builders
Documentation
A Set
type designed for types that are Enum
as well as Ord
. This allows the RangeSet
to
compress the data when it is contiguous, reducing memory-footprint and enabling otherwise impractical
operations like complement
for Bounded
types.
Since: 0.0.1.0
module Data.RangeSet.Primitives
extractSingle :: Enum a => RangeSet a -> Maybe a Source #
Possibly extract the element contained in the set if it is a singleton set.
Since: 0.0.1.0
sizeRanges :: RangeSet a -> Int Source #
Return the number of contiguous ranges that populate the set.
Since: 0.0.1.0
notMember :: Enum a => a -> RangeSet a -> Bool Source #
Test whether or not a given value is not found within the set.
Since: 0.0.1.0
findMin :: Enum a => RangeSet a -> Maybe a Source #
Find the minimum value within the set, if one exists.
Since: 0.0.1.0
findMax :: Enum a => RangeSet a -> Maybe a Source #
Find the maximum value within the set, if one exists.
Since: 0.0.1.0
module Data.RangeSet.SetCrossSet
complement :: forall a. (Bounded a, Enum a) => RangeSet a -> RangeSet a Source #
Inverts a set: every value which was an element is no longer an element, and every value that
was not an element now is. This is only possible on Bounded
types.
Since: 0.0.1.0
isSubsetOf :: RangeSet a -> RangeSet a -> Bool Source #
Tests if all the elements of the first set appear in the second.
Since: 0.0.1.0
isProperSubsetOf :: RangeSet a -> RangeSet a -> Bool Source #
Tests if all the element of the first set appear in the second, but also that the first and second sets are not equal.
Since: 0.0.1.0
allLess :: Enum a => a -> RangeSet a -> RangeSet a Source #
Filters a set by removing all values greater than or equal to the given value.
Since: 0.0.1.0
allMore :: Enum a => a -> RangeSet a -> RangeSet a Source #
Filters a set by removing all values less than or equal to the given value.
Since: 0.0.1.0
elems :: Enum a => RangeSet a -> [a] Source #
Returns all the elements found within the set.
Since: 0.0.1.0
unelems :: forall a. (Bounded a, Enum a) => RangeSet a -> [a] Source #
Returns all the values that are not found within the set.
Since: 0.0.1.0
module Data.RangeSet.Builders