Safe Haskell | None |
---|---|
Language | Haskell2010 |
Unification terms.
These represent the known state of a unification variable.
Synopsis
- data UTerm v ast
- = UUnbound (TypeConstraintsOf (GetKnot ast))
- | USkolem (TypeConstraintsOf (GetKnot ast))
- | UToVar (v ast)
- | UTerm (UTermBody v ast)
- | UInstantiated (v ast)
- | UResolving (UTermBody v ast)
- | UResolved (Pure ast)
- | UConverted Int
- _UUnbound :: forall v ast. Prism' (UTerm v ast) (TypeConstraintsOf (GetKnot ast))
- _USkolem :: forall v ast. Prism' (UTerm v ast) (TypeConstraintsOf (GetKnot ast))
- _UToVar :: forall v ast. Prism' (UTerm v ast) (v ast)
- _UTerm :: forall v ast. Prism' (UTerm v ast) (UTermBody v ast)
- _UInstantiated :: forall v ast. Prism' (UTerm v ast) (v ast)
- _UResolving :: forall v ast. Prism' (UTerm v ast) (UTermBody v ast)
- _UResolved :: forall v ast. Prism' (UTerm v ast) (Pure ast)
- _UConverted :: forall v ast. Prism' (UTerm v ast) Int
- data UTermBody v ast = UTermBody {
- _uConstraints :: TypeConstraintsOf (GetKnot ast)
- _uBody :: ast # v
- uBody :: forall v ast v. Lens (UTermBody v ast) (UTermBody v ast) ((#) ast v) ((#) ast v)
- uConstraints :: forall v ast. Lens' (UTermBody v ast) (TypeConstraintsOf (GetKnot ast))
Documentation
A unification term pointed by a unification variable
UUnbound (TypeConstraintsOf (GetKnot ast)) | Unbound variable with at least the given constraints |
USkolem (TypeConstraintsOf (GetKnot ast)) | A variable bound by a rigid quantified variable with *exactly* the given constraints |
UToVar (v ast) | Unified with another variable (union-find) |
UTerm (UTermBody v ast) | Known type term with unification variables as children |
UInstantiated (v ast) | Temporary state during instantiation indicating which fresh unification variable a skolem is mapped to |
UResolving (UTermBody v ast) | Temporary state while unification term is being traversed, if it occurs inside itself (detected via state still being UResolving), then the type is an infinite type |
UResolved (Pure ast) | Final resolved state. |
UConverted Int | Temporary state used in AST.Unify.Binding.ST.Save while converting to a pure binding |
Instances
_UInstantiated :: forall v ast. Prism' (UTerm v ast) (v ast) Source #
A unification term with a known body
UTermBody | |
|
Instances
uConstraints :: forall v ast. Lens' (UTermBody v ast) (TypeConstraintsOf (GetKnot ast)) Source #