Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- data Key
- data DiscrimTree a
- = EmptyDT
- | DoneDT (Set a)
- | CaseDT !Int (Map Key (DiscrimTree a)) (DiscrimTree a)
- mergeDT :: Ord a => DiscrimTree a -> DiscrimTree a -> DiscrimTree a
- singletonDT :: [Key] -> a -> DiscrimTree a
Documentation
RigidK !QName !Int | Rigid symbols (constructors, data types, record types, postulates) identified by a QName. |
LocalK !Int !Int | Local variables. |
PiK | Dependent function types. The domain will be represented accurately, for the case of a genuine dependent function type, the codomain will be a dummy. |
ConstK | Constant lambdas. |
SortK | Universes. |
FlexK | Anything else. |
Instances
data DiscrimTree a Source #
A Term
-indexed associative data structure supporting
approximate (conservative) lookup. Rather than using a Trie
keyed
by Key
directly, a DiscrimTree
is instead represented more like a
case tree.
This allows us to exploit the fact that instance selection often
focuses on a small part of the term: Only that critical chain is
represented in the tree. As an example, level parameters are unlikely
to contribute to narrowing a search problem, so it would be wasteful
to have an indirection in the tree for every FlexK
standing for a
level parameter.
EmptyDT | The empty discrimination tree. |
DoneDT (Set a) | Succeed with a given set of values. |
CaseDT | Do case analysis on a term. |
|
Instances
mergeDT :: Ord a => DiscrimTree a -> DiscrimTree a -> DiscrimTree a Source #
singletonDT :: [Key] -> a -> DiscrimTree a Source #