ghc-8.8.3: The GHC API
Safe HaskellNone
LanguageHaskell2010

RnTypes

Synopsis

Documentation

data HsSigWcTypeScoping Source #

Constructors

AlwaysBind

Always bind any free tyvars of the given type, regardless of whether we have a forall at the top

BindUnlessForall

Unless there's forall at the top, do the same thing as AlwaysBind

NeverBind

Never bind any free tyvars

rnImplicitBndrs :: Bool -> FreeKiTyVarsWithDups -> ([Name] -> RnM (a, FreeVars)) -> RnM (a, FreeVars) Source #

bindLRdrNames :: [Located RdrName] -> ([Name] -> RnM (a, FreeVars)) -> RnM (a, FreeVars) Source #

Simply bring a bunch of RdrNames into scope. No checking for validity, at all. The binding location is taken from the location on each name.

extractFilteredRdrTyVars :: LHsType GhcPs -> RnM FreeKiTyVarsNoDups Source #

Finds free type and kind variables in a type, without duplicates, and without variables that are already in scope in LocalRdrEnv NB: this includes named wildcards, which look like perfectly ordinary type variables at this point

extractFilteredRdrTyVarsDups :: LHsType GhcPs -> RnM FreeKiTyVarsWithDups Source #

Finds free type and kind variables in a type, with duplicates, but without variables that are already in scope in LocalRdrEnv NB: this includes named wildcards, which look like perfectly ordinary type variables at this point

extractHsTyRdrTyVars :: LHsType GhcPs -> FreeKiTyVarsNoDups Source #

extractHsTyRdrTyVarsKindVars :: LHsType GhcPs -> [Located RdrName] Source #

Extracts the free kind variables (but not the type variables) of an HsType. Does not return any wildcards. When the same name occurs multiple times in the type, only the first occurrence is returned, and the left-to-right order of variables is preserved. See Note [Kind and type-variable binders] and Note [Ordering of implicit variables].

extractHsTyRdrTyVarsDups :: LHsType GhcPs -> FreeKiTyVarsWithDups Source #

extractHsTyRdrTyVarsDups find the free (kind, type) variables of an HsType or the free (sort, kind) variables of an HsKind. It's used when making the foralls explicit. Does not return any wildcards. When the same name occurs multiple times in the types, all occurrences are returned.

extractHsTysRdrTyVars :: [LHsType GhcPs] -> FreeKiTyVarsNoDups Source #

Extracts free type and kind variables from types in a list. When the same name occurs multiple times in the types, only the first occurrence is returned and the rest is filtered out. See Note [Kind and type-variable binders]

extractHsTysRdrTyVarsDups :: [LHsType GhcPs] -> FreeKiTyVarsWithDups Source #

Extracts free type and kind variables from types in a list. When the same name occurs multiple times in the types, all occurrences are returned.

rmDupsInRdrTyVars :: FreeKiTyVarsWithDups -> FreeKiTyVarsNoDups Source #

Removes multiple occurrences of the same name from FreeKiTyVars. If a variable occurs as both a kind and a type variable, only keep the occurrence as a kind variable. See also Note [Kind and type-variable binders]

extractHsTvBndrs :: [LHsTyVarBndr GhcPs] -> FreeKiTyVarsWithDups -> FreeKiTyVarsWithDups Source #