Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Synopsis
- type TypeSub = Map TyName (Type TyName DefaultUni ())
- substTypeCustomGo ∷ HasCallStack ⇒ Bool → Set TyName → TypeSub → Type TyName DefaultUni () → Type TyName DefaultUni ()
- substEscape ∷ Set TyName → TypeSub → Type TyName DefaultUni () → Type TyName DefaultUni ()
- substTypeCustom ∷ HasCallStack ⇒ Bool → TypeSub → Type TyName DefaultUni () → Type TyName DefaultUni ()
- substType ∷ HasCallStack ⇒ TypeSub → Type TyName DefaultUni () → Type TyName DefaultUni ()
- substTypeParallel ∷ TypeSub → Type TyName DefaultUni () → Type TyName DefaultUni ()
- renameVar ∷ TyName → TyName → Type TyName DefaultUni () → Type TyName DefaultUni ()
- fvTypeR ∷ TypeSub → Type TyName DefaultUni () → Set TyName
- fvTypeBag ∷ Type TyName DefaultUni () → Map TyName Int
- genSubst ∷ TypeCtx → Gen TypeSub
- shrinkSubst ∷ TypeCtx → TypeSub → [TypeSub]
Documentation
∷ HasCallStack | |
⇒ Bool | |
→ Set TyName | Variables that are considered free. |
→ TypeSub | Type substitution to use. |
→ Type TyName DefaultUni () | Type to substitute in. |
→ Type TyName DefaultUni () |
The most general substitution worker.
substEscape ∷ Set TyName → TypeSub → Type TyName DefaultUni () → Type TyName DefaultUni () Source #
∷ HasCallStack | |
⇒ Bool | Nested (True) or parallel (False) |
→ TypeSub | |
→ Type TyName DefaultUni () | |
→ Type TyName DefaultUni () |
Generalized substitution algorithm.
substType ∷ HasCallStack ⇒ TypeSub → Type TyName DefaultUni () → Type TyName DefaultUni () Source #
Regular (i.e. nested type substitution).
substTypeParallel ∷ TypeSub → Type TyName DefaultUni () → Type TyName DefaultUni () Source #
Parallel substitution.
renameVar ∷ TyName → TyName → Type TyName DefaultUni () → Type TyName DefaultUni () Source #
Rename one variable to another.
fvTypeR ∷ TypeSub → Type TyName DefaultUni () → Set TyName Source #
Find all free type variables of type a
given substitution sub
. If variable x
is
free in a
but in the domain of sub
we look up x
in sub
and get all the free type
variables of the result - up to the substitution.
Generators for substitutions
fvTypeBag ∷ Type TyName DefaultUni () → Map TyName Int Source #
Get the free type variables in a type along with how many times they occur. The elements of the map are guaranteed to be non-zero.