Safe Haskell | Safe |
---|---|
Language | Haskell98 |
Deprecated: Use Data.Range.Algebra instead
Synopsis
- evaluate :: (Ord a, Enum a) => RangeTree a -> [Range a]
- data RangeTree a
- = RangeNode RangeOperation (RangeTree a) (RangeTree a)
- | RangeNodeInvert (RangeTree a)
- | RangeLeaf [Range a]
- data RangeOperation
Documentation
evaluate :: (Ord a, Enum a) => RangeTree a -> [Range a] Source #
Evaluates a Range Tree into the final set of ranges that it compresses down to. Use this whenever you want to finally evaluate your constructed Range Tree.
A Range Tree is a construct that can be built and then efficiently evaluated so that you can compress an entire tree of operations on ranges into a single range quickly. The only purpose of this tree is to allow efficient construction of range operations that can be evaluated as is required.
RangeNode RangeOperation (RangeTree a) (RangeTree a) | Combine two range trees together with a single operation |
RangeNodeInvert (RangeTree a) | Invert a range tree, this is a |
RangeLeaf [Range a] | A leaf with a set of ranges that are collected together. |
data RangeOperation Source #
These are the operations that can join two disjunct lists of ranges together.
RangeUnion | Represents the set union operation. |
RangeIntersection | Represents the set intersection operation. |
RangeDifference | Represents the set difference operation. |