- type TyVar = Int
- data Type
- type QType = ([TyVar], Type)
- type TySubst = [(Int, Type)]
- type TyEnv = [(Var, QType)]
- emptyTySubst :: TySubst
- applyTySubst :: TySubst -> Type -> Type
- normalizeType :: Type -> State (Int, [(Int, Int)]) Type
- instanceOf :: Type -> Type -> Failure ()
- unify :: Type -> Type -> Failure TySubst
- unifyAll :: [Type] -> Failure TySubst
- composeTySubst :: [TySubst] -> Failure TySubst
- disjoinSubst :: TySubst -> TySubst -> TySubst
Documentation
applyTySubst :: TySubst -> Type -> TypeSource
ftvs: free type variables
ftvsSubst: the free type variables of a type substitution--that is, the type variables free in the types in the range of the substitution.
occurs x ty: does variable x appear in type ty? (Note there are no type-variable binders).
normalizeType :: Type -> State (Int, [(Int, Int)]) TypeSource
normalizeType: Renumber all the type variables in a normal way to allow comparing types.
instanceOf :: Type -> Type -> Failure ()Source
composeTySubst :: [TySubst] -> Failure TySubstSource
disjoinSubst :: TySubst -> TySubst -> TySubstSource