| |||||||||||||
| |||||||||||||
| Description | |||||||||||||
| substitution and unification of types | |||||||||||||
| Synopsis | |||||||||||||
| Documentation | |||||||||||||
| varsOf :: Type -> [TypeArg] | |||||||||||||
| generalize :: TypeScheme -> TypeScheme | |||||||||||||
| compSubst :: Subst -> Subst -> Subst | |||||||||||||
| composition (reversed: first substitution first!) | |||||||||||||
| isUnifiable :: TypeMap -> Int -> TypeScheme -> TypeScheme -> Bool | |||||||||||||
| unifiability of type schemes including instantiation with fresh variables (and looking up type aliases) | |||||||||||||
| instScheme :: TypeMap -> Int -> TypeScheme -> TypeScheme -> Bool | |||||||||||||
| test if second scheme is a substitution instance | |||||||||||||
| toEnvState :: State Int a -> State Env a | |||||||||||||
| lift State Int to State Env | |||||||||||||
| toSchemes :: (Type -> Type -> a) -> TypeScheme -> TypeScheme -> State Int a | |||||||||||||
| asSchemes :: Int -> (Type -> Type -> a) -> TypeScheme -> TypeScheme -> a | |||||||||||||
| freshInst :: TypeScheme -> State Int Type | |||||||||||||
| freshVar :: State Int Id | |||||||||||||
| mkSingleSubst :: TypeArg -> State Int Subst | |||||||||||||
| mkSubst :: [TypeArg] -> State Int Subst | |||||||||||||
| type Subst = Map TypeArg Type | |||||||||||||
| eps :: Subst | |||||||||||||
| class Unifiable a where | |||||||||||||
| |||||||||||||
| mgu :: Unifiable a => TypeMap -> a -> a -> Result Subst | |||||||||||||
| most general unifier via match where both sides may contribute substitutions | |||||||||||||
| unify :: Unifiable a => TypeMap -> a -> a -> Bool | |||||||||||||
| subsume :: Unifiable a => TypeMap -> a -> a -> Bool | |||||||||||||
| equalSubs :: Unifiable a => TypeMap -> a -> a -> Bool | |||||||||||||
| starTypeInfo :: TypeInfo | |||||||||||||
| showPrettyWithPos :: (PrettyPrint a, PosItem a) => a -> ShowS | |||||||||||||
| uniResult :: (PrettyPrint a, PosItem a, PrettyPrint b, PosItem b) => String -> a -> String -> b -> Result Subst | |||||||||||||
| occursIn :: TypeMap -> TypeId -> Type -> Bool | |||||||||||||
| expandAlias :: TypeMap -> Type -> (Type, Bool) | |||||||||||||
| expandAliases :: TypeMap -> Type -> ([TypeArg], [Type], Type, Bool) | |||||||||||||
| Produced by Haddock version 0.6 |