Copyright | (c) Christian Maeder and Uni Bremen 2003-2005 |
---|---|
License | GPLv2 or higher, see LICENSE.txt |
Maintainer | Christian.Maeder@dfki.de |
Stability | experimental |
Portability | portable |
Safe Haskell | None |
analyse types
Synopsis
- getIdKind :: Env -> Id -> Result ((Variance, RawKind, Set Kind), Type)
- getCoVarKind :: Maybe Bool -> Env -> Id -> Result ((RawKind, Set Kind), Type)
- subKinds :: DiagKind -> ClassMap -> Type -> Set Kind -> Set Kind -> Set Kind -> Result (Set Kind)
- addTypeVarDecl :: Bool -> TypeArg -> State Env ()
- addLocalTypeVar :: Bool -> TypeVarDefn -> Id -> State Env ()
- inferKinds :: Maybe Bool -> Type -> Env -> Result ((RawKind, Set Kind), Type)
- rawKindOfType :: Type -> RawKind
- lesserType :: Env -> Type -> Type -> Bool
- lesserTypeScheme :: Env -> TypeScheme -> TypeScheme -> Bool
- lesserOpInfo :: Env -> OpInfo -> OpInfo -> Bool
- getMinAssumps :: Env -> Id -> [OpInfo]
- idsOf :: (Int -> Bool) -> Type -> Set Id
- superIds :: TypeMap -> Id -> Set Id
- supIds :: TypeMap -> Set Id -> Set Id -> Set Id
- expand :: TypeMap -> TypeScheme -> TypeScheme
- filterAliases :: TypeMap -> TypeMap
- expandAlias :: TypeMap -> Type -> Type
- expandAliases :: TypeMap -> Type -> Type
- expandAux :: TypeMap -> Type -> Type
- hasAlias :: TypeMap -> Type -> [Diagnosis]
- anaTypeM :: (Maybe Kind, Type) -> Env -> Result ((RawKind, Set Kind), Type)
- anaStarTypeM :: Type -> Env -> Result ((RawKind, Set Kind), Type)
- cyclicType :: Id -> Type -> Bool
- unboundTypevars :: Bool -> [TypeArg] -> Type -> [Diagnosis]
- generalizable :: Bool -> TypeScheme -> [Diagnosis]
- checkUniqueTypevars :: [TypeArg] -> [Diagnosis]
infer kind
getIdKind :: Env -> Id -> Result ((Variance, RawKind, Set Kind), Type) Source #
extract kinds of type identifier
getCoVarKind :: Maybe Bool -> Env -> Id -> Result ((RawKind, Set Kind), Type) Source #
extract kinds of co- or invariant type identifiers
subKinds :: DiagKind -> ClassMap -> Type -> Set Kind -> Set Kind -> Set Kind -> Result (Set Kind) Source #
check if there is at least one solution
addTypeVarDecl :: Bool -> TypeArg -> State Env () Source #
add an analysed type argument (warn on redeclared types)
addLocalTypeVar :: Bool -> TypeVarDefn -> Id -> State Env () Source #
inferKinds :: Maybe Bool -> Type -> Env -> Result ((RawKind, Set Kind), Type) Source #
infer all minimal kinds
rawKindOfType :: Type -> RawKind Source #
extract the raw kind from a type term
lesserTypeScheme :: Env -> TypeScheme -> TypeScheme -> Bool Source #
super type ids
supIds :: TypeMap -> Set Id -> Set Id -> Set Id Source #
compute all super type ids for several type ids given as second argument
expand alias types
expand :: TypeMap -> TypeScheme -> TypeScheme Source #
expand aliases in a type scheme
filterAliases :: TypeMap -> TypeMap Source #
resolve and analyse types
anaTypeM :: (Maybe Kind, Type) -> Env -> Result ((RawKind, Set Kind), Type) Source #
resolve type and infer minimal kinds
anaStarTypeM :: Type -> Env -> Result ((RawKind, Set Kind), Type) Source #
resolve the type and check if it is of the universe class
misc functions on types
cyclicType :: Id -> Type -> Bool Source #
check if an id occurs in a type
unboundTypevars :: Bool -> [TypeArg] -> Type -> [Diagnosis] Source #
check for unbound (or if False for too many) type variables
generalizable :: Bool -> TypeScheme -> [Diagnosis] Source #
check for proper generalizability (False: warn also for unused types)
checkUniqueTypevars :: [TypeArg] -> [Diagnosis] Source #
check uniqueness of type variables