Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- kcHsSigType :: [Located Name] -> LHsSigType GhcRn -> TcM ()
- tcClassSigType :: [Located Name] -> LHsSigType GhcRn -> TcM Type
- tcHsSigType :: UserTypeCtxt -> LHsSigType GhcRn -> TcM Type
- tcHsSigWcType :: UserTypeCtxt -> LHsSigWcType GhcRn -> TcM Type
- tcHsPartialSigType :: UserTypeCtxt -> LHsSigWcType GhcRn -> TcM ([(Name, TcTyVar)], Maybe TcTyVar, [TcTyVar], TcThetaType, TcType)
- funsSigCtxt :: [Located Name] -> UserTypeCtxt
- addSigCtxt :: UserTypeCtxt -> LHsType GhcRn -> TcM a -> TcM a
- pprSigCtxt :: UserTypeCtxt -> LHsType GhcRn -> SDoc
- tcHsClsInstType :: UserTypeCtxt -> LHsSigType GhcRn -> TcM ([TyVar], ThetaType, Class, [Type])
- tcHsDeriv :: LHsSigType GhcRn -> TcM ([TyVar], Class, [Type], [Kind])
- tcHsVectInst :: LHsSigType GhcRn -> TcM (Class, [Type])
- tcHsTypeApp :: LHsWcType GhcRn -> Kind -> TcM Type
- data UserTypeCtxt
- = FunSigCtxt Name Bool
- | InfSigCtxt Name
- | ExprSigCtxt
- | TypeAppCtxt
- | ConArgCtxt Name
- | TySynCtxt Name
- | PatSynCtxt Name
- | PatSigCtxt
- | RuleSigCtxt Name
- | ResSigCtxt
- | ForSigCtxt Name
- | DefaultDeclCtxt
- | InstDeclCtxt
- | SpecInstCtxt
- | ThBrackCtxt
- | GenSigCtxt
- | GhciCtxt
- | ClassSCCtxt Name
- | SigmaCtxt
- | DataTyCtxt Name
- tcImplicitTKBndrs :: [Name] -> TcM (a, TyVarSet) -> TcM ([TcTyVar], a)
- tcImplicitTKBndrsType :: [Name] -> TcM Type -> TcM ([TcTyVar], Type)
- tcExplicitTKBndrs :: [LHsTyVarBndr GhcRn] -> ([TyVar] -> TcM (a, TyVarSet)) -> TcM (a, TyVarSet)
- kcLookupTcTyCon :: Name -> TcM TcTyCon
- kcTyClTyVars :: Name -> TcM a -> TcM a
- tcTyClTyVars :: Name -> ([TyConBinder] -> Kind -> TcM a) -> TcM a
- tcDataKindSig :: DataKindCheck -> Kind -> TcM ([TyConBinder], Kind)
- data DataKindCheck
- tcWildCardBinders :: [Name] -> ([(Name, TcTyVar)] -> TcM a) -> TcM a
- kcHsTyVarBndrs :: Name -> TyConFlavour -> Bool -> Bool -> LHsQTyVars GhcRn -> TcM (Kind, r) -> TcM (TcTyCon, r)
- tcHsLiftedType :: LHsType GhcRn -> TcM TcType
- tcHsOpenType :: LHsType GhcRn -> TcM TcType
- tcHsLiftedTypeNC :: LHsType GhcRn -> TcM TcType
- tcHsOpenTypeNC :: LHsType GhcRn -> TcM TcType
- tcLHsType :: LHsType GhcRn -> TcM (TcType, TcKind)
- tcLHsTypeUnsaturated :: LHsType GhcRn -> TcM (TcType, TcKind)
- tcCheckLHsType :: LHsType GhcRn -> Kind -> TcM TcType
- tcHsContext :: LHsContext GhcRn -> TcM [PredType]
- tcLHsPredType :: LHsType GhcRn -> TcM PredType
- tcInferApps :: TcTyMode -> Maybe (VarEnv Kind) -> LHsType GhcRn -> TcType -> TcKind -> [LHsType GhcRn] -> TcM (TcType, [TcType], TcKind)
- solveEqualities :: TcM a -> TcM a
- typeLevelMode :: TcTyMode
- kindLevelMode :: TcTyMode
- kindGeneralize :: TcType -> TcM [KindVar]
- checkExpectedKindX :: Maybe (VarEnv Kind) -> SDoc -> TcType -> TcKind -> TcKind -> TcM (TcType, [TcType], TcCoercionN)
- instantiateTyUntilN :: Maybe (VarEnv Kind) -> Int -> TcType -> TcKind -> TcM (TcType, [TcType], TcKind)
- reportFloatingKvs :: Name -> TyConFlavour -> [TcTyVar] -> [TcTyVar] -> TcM ()
- tcLHsKindSig :: LHsKind GhcRn -> TcM Kind
- tcHsPatSigType :: UserTypeCtxt -> LHsSigWcType GhcRn -> TcM ([(Name, TcTyVar)], [(Name, TcTyVar)], TcType)
- tcPatSig :: Bool -> LHsSigWcType GhcRn -> ExpSigmaType -> TcM (TcType, [(Name, TcTyVar)], [(Name, TcTyVar)], HsWrapper)
- funAppCtxt :: (Outputable fun, Outputable arg) => fun -> arg -> Int -> SDoc
Documentation
kcHsSigType :: [Located Name] -> LHsSigType GhcRn -> TcM () Source #
tcClassSigType :: [Located Name] -> LHsSigType GhcRn -> TcM Type Source #
tcHsSigType :: UserTypeCtxt -> LHsSigType GhcRn -> TcM Type Source #
tcHsSigWcType :: UserTypeCtxt -> LHsSigWcType GhcRn -> TcM Type Source #
tcHsPartialSigType :: UserTypeCtxt -> LHsSigWcType GhcRn -> TcM ([(Name, TcTyVar)], Maybe TcTyVar, [TcTyVar], TcThetaType, TcType) Source #
funsSigCtxt :: [Located Name] -> UserTypeCtxt Source #
addSigCtxt :: UserTypeCtxt -> LHsType GhcRn -> TcM a -> TcM a Source #
pprSigCtxt :: UserTypeCtxt -> LHsType GhcRn -> SDoc Source #
tcHsClsInstType :: UserTypeCtxt -> LHsSigType GhcRn -> TcM ([TyVar], ThetaType, Class, [Type]) Source #
tcHsVectInst :: LHsSigType GhcRn -> TcM (Class, [Type]) Source #
data UserTypeCtxt Source #
tcImplicitTKBndrsType :: [Name] -> TcM Type -> TcM ([TcTyVar], Type) Source #
Convenient specialization
kcTyClTyVars :: Name -> TcM a -> TcM a Source #
Bring tycon tyvars into scope. This is used during the "kind-checking" pass in TcTyClsDecls. (Never in getInitialKind, never in the "type-checking"/desugaring pass.) Never emits constraints, though the thing_inside might.
tcTyClTyVars :: Name -> ([TyConBinder] -> Kind -> TcM a) -> TcM a Source #
Used for the type variables of a type or class decl on the second full pass (type-checking/desugaring) in TcTyClDecls. This is *not* used in the initial-kind run, nor in the "kind-checking" pass. Accordingly, everything passed to the continuation is fully zonked.
(tcTyClTyVars T [a,b] thing_inside) where T : forall k1 k2 (a:k1 -> *) (b:k1). k2 -> * calls thing_inside with arguments [k1,k2,a,b] [k1:*, k2:*, Anon (k1 -> *), Anon k1] (k2 -> *) having also extended the type environment with bindings for k1,k2,a,b
Never emits constraints.
The LHsTyVarBndrs is always user-written, and the full, generalised kind of the tycon is available in the local env.
:: DataKindCheck | Do we require the result to be *? |
-> Kind | |
-> TcM ([TyConBinder], Kind) |
:: Name | of the thing being checked |
-> TyConFlavour | What sort of |
-> Bool | True = the decl being checked has a CUSK |
-> Bool | True = all the hsq_implicit are *kind* vars (will give these kind * if -XNoTypeInType) |
-> LHsQTyVars GhcRn | |
-> TcM (Kind, r) | The result kind, possibly with other info |
-> TcM (TcTyCon, r) | A suitably-kinded TcTyCon |
Kind-check a LHsQTyVars
. If the decl under consideration has a complete,
user-supplied kind signature (CUSK), generalise the result.
Used in getInitialKind
(for tycon kinds and other kinds)
and in kind-checking (but not for tycon kinds, which are checked with
tcTyClDecls). See also Note [Complete user-supplied kind signatures] in
HsDecls.
This function does not do telescope checking.
tcHsContext :: LHsContext GhcRn -> TcM [PredType] Source #
:: TcTyMode | |
-> Maybe (VarEnv Kind) | Possibly, kind info (see above) |
-> LHsType GhcRn | Function (for printing only) |
-> TcType | Function (could be knot-tied) |
-> TcKind | Function kind (zonked) |
-> [LHsType GhcRn] | Args |
-> TcM (TcType, [TcType], TcKind) | (f args, args, result kind) |
Apply a type of a given kind to a list of arguments. This instantiates
invisible parameters as necessary. Always consumes all the arguments,
using matchExpectedFunKind as necessary.
This takes an optional VarEnv Kind
which maps kind variables to kinds.
These kinds should be used to instantiate invisible kind variables;
they come from an enclosing class for an associated type/data family.
solveEqualities :: TcM a -> TcM a Source #
Type-check a thing that emits only equality constraints, then solve those constraints. Fails outright if there is trouble.
typeLevelMode :: TcTyMode Source #
kindLevelMode :: TcTyMode Source #
checkExpectedKindX :: Maybe (VarEnv Kind) -> SDoc -> TcType -> TcKind -> TcKind -> TcM (TcType, [TcType], TcCoercionN) Source #
:: Maybe (VarEnv Kind) | Possibly, instantiations for vars |
-> Int | n |
-> TcType | the type |
-> TcKind | its kind |
-> TcM (TcType, [TcType], TcKind) | The inst'ed type, new args, final kind |
Instantiate a type to have at most n
invisible arguments.
reportFloatingKvs :: Name -> TyConFlavour -> [TcTyVar] -> [TcTyVar] -> TcM () Source #
tcHsPatSigType :: UserTypeCtxt -> LHsSigWcType GhcRn -> TcM ([(Name, TcTyVar)], [(Name, TcTyVar)], TcType) Source #
tcPatSig :: Bool -> LHsSigWcType GhcRn -> ExpSigmaType -> TcM (TcType, [(Name, TcTyVar)], [(Name, TcTyVar)], HsWrapper) Source #
funAppCtxt :: (Outputable fun, Outputable arg) => fun -> arg -> Int -> SDoc Source #
Make an appropriate message for an error in a function argument. Used for both expressions and types.