| License | MIT |
|---|---|
| Safe Haskell | None |
| Language | GHC2021 |
Language.Egison.Type.Subst
Description
This module provides type substitution operations for the type system.
Synopsis
- newtype Subst = Subst {}
- emptySubst :: Subst
- singletonSubst :: TyVar -> Type -> Subst
- composeSubst :: Subst -> Subst -> Subst
- applySubst :: Subst -> Type -> Type
- applySubstScheme :: Subst -> TypeScheme -> TypeScheme
- applySubstConstraint :: Subst -> Constraint -> Constraint
- data SubstIndex
- emptySubstIndex :: SubstIndex
- singletonSubstIndex :: IndexTyVar -> Index -> SubstIndex
- applySubstIndex :: SubstIndex -> IndexSpec -> IndexSpec
Documentation
Type substitution: a mapping from type variables to types
emptySubst :: Subst Source #
Empty substitution
composeSubst :: Subst -> Subst -> Subst Source #
Compose two substitutions (s2 after s1)
(s2 composeSubst s1) x = s2 (s1 x)
applySubstScheme :: Subst -> TypeScheme -> TypeScheme Source #
Apply a substitution to a type scheme
applySubstConstraint :: Subst -> Constraint -> Constraint Source #
Apply a substitution to a constraint
data SubstIndex Source #
Index substitution: mapping from index variables to indices
Instances
emptySubstIndex :: SubstIndex Source #
Empty index substitution
singletonSubstIndex :: IndexTyVar -> Index -> SubstIndex Source #
Create an index substitution with a single binding
applySubstIndex :: SubstIndex -> IndexSpec -> IndexSpec Source #
Apply an index substitution to an index specification