Safe Haskell | None |
---|---|
Language | Haskell2010 |
- kcHsSigType :: [Located Name] -> LHsSigType Name -> TcM ()
- tcClassSigType :: [Located Name] -> LHsSigType Name -> TcM Type
- tcHsSigType :: UserTypeCtxt -> LHsSigType Name -> TcM Type
- tcHsSigWcType :: UserTypeCtxt -> LHsSigWcType Name -> TcM Type
- funsSigCtxt :: [Located Name] -> UserTypeCtxt
- addSigCtxt :: UserTypeCtxt -> LHsType Name -> TcM a -> TcM a
- tcHsClsInstType :: UserTypeCtxt -> LHsSigType Name -> TcM ([TyVar], ThetaType, Class, [Type])
- tcHsDeriv :: LHsSigType Name -> TcM ([TyVar], Class, [Type], Kind)
- tcHsVectInst :: LHsSigType Name -> TcM (Class, [Type])
- tcHsTypeApp :: LHsWcType Name -> 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 Name] -> ([TyVar] -> TcM (a, TyVarSet)) -> TcM (a, TyVarSet)
- kcLookupKind :: Name -> TcM Kind
- kcTyClTyVars :: Name -> LHsQTyVars Name -> TcM a -> TcM a
- tcTyClTyVars :: Name -> LHsQTyVars Name -> ([TyVar] -> [TyVar] -> Kind -> Kind -> TcM a) -> TcM a
- tcHsConArgType :: NewOrData -> LHsType Name -> TcM Type
- tcDataKindSig :: Kind -> TcM [TyVar]
- tcWildCardBinders :: [Name] -> ([(Name, TcTyVar)] -> TcM a) -> TcM a
- kcHsTyVarBndrs :: Bool -> LHsQTyVars Name -> ([TyVar] -> [TyVar] -> TcM (Kind, r)) -> TcM (Kind, r)
- tcHsLiftedType :: LHsType Name -> TcM TcType
- tcHsOpenType :: LHsType Name -> TcM TcType
- tcHsLiftedTypeNC :: LHsType Name -> TcM TcType
- tcHsOpenTypeNC :: LHsType Name -> TcM TcType
- tcLHsType :: LHsType Name -> TcM (TcType, TcKind)
- tcCheckLHsType :: LHsType Name -> Kind -> TcM Type
- tcHsContext :: LHsContext Name -> TcM [PredType]
- tcLHsPredType :: LHsType Name -> TcM PredType
- tcInferApps :: Outputable fun => TcTyMode -> fun -> TcType -> TcKind -> [LHsType Name] -> TcM (TcType, TcKind)
- tcInferArgs :: Outputable fun => fun -> TcKind -> Maybe (VarEnv Kind) -> [LHsType Name] -> TcM (TcKind, [TcType], [LHsType Name], Int)
- solveEqualities :: TcM a -> TcM a
- kindGeneralize :: TcType -> TcM [KindVar]
- tcLHsKind :: LHsKind Name -> TcM Kind
- tcHsPatSigType :: UserTypeCtxt -> LHsSigWcType Name -> TcM (Type, [TcTyVar], [(Name, TcTyVar)])
- tcPatSig :: Bool -> LHsSigWcType Name -> ExpSigmaType -> TcM (TcType, [TcTyVar], [(Name, TcTyVar)], HsWrapper)
- funAppCtxt :: (Outputable fun, Outputable arg) => fun -> arg -> Int -> SDoc
Documentation
kcHsSigType :: [Located Name] -> LHsSigType Name -> TcM () Source
tcClassSigType :: [Located Name] -> LHsSigType Name -> TcM Type Source
tcHsSigType :: UserTypeCtxt -> LHsSigType Name -> TcM Type Source
tcHsSigWcType :: UserTypeCtxt -> LHsSigWcType Name -> TcM Type Source
funsSigCtxt :: [Located Name] -> UserTypeCtxt Source
addSigCtxt :: UserTypeCtxt -> LHsType Name -> TcM a -> TcM a Source
tcHsClsInstType :: UserTypeCtxt -> LHsSigType Name -> TcM ([TyVar], ThetaType, Class, [Type]) Source
tcHsVectInst :: LHsSigType Name -> TcM (Class, [Type]) Source
data UserTypeCtxt Source
tcImplicitTKBndrsType :: [Name] -> TcM Type -> TcM ([TcTyVar], Type) Source
Convenient specialization
kcLookupKind :: Name -> TcM Kind Source
:: Name | of the tycon |
-> LHsQTyVars Name | |
-> TcM a | |
-> TcM a |
"Kind check" the tyvars to a tycon. This is used during the "kind-checking" pass in TcTyClsDecls. (Never in getInitialKind, never in the "type-checking"/desugaring pass.) It works only for LHsQTyVars associated with a tycon, whose kind is known (partially) via getInitialKinds. Never emits constraints, though the thing_inside might.
tcTyClTyVars :: Name -> LHsQTyVars Name -> ([TyVar] -> [TyVar] -> Kind -> 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.
(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] (forall (k1:*) (k2:*) (a:k1 -> *) (b:k1). k2 -> *) (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.
tcDataKindSig :: Kind -> TcM [TyVar] Source
:: Bool | True = the decl being checked has a CUSK |
-> LHsQTyVars Name | |
-> ([TyVar] -> [TyVar] -> TcM (Kind, r)) | the result kind, possibly with other info ^ args are implicit vars, explicit vars |
-> TcM (Kind, r) | The full kind of the thing being declared, with the other info |
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 Name -> TcM [PredType] Source
:: Outputable fun | |
=> TcTyMode | |
-> fun | Function (for printing only) |
-> TcType | Function (could be knot-tied) |
-> TcKind | Function kind (zonked) |
-> [LHsType Name] | Args |
-> TcM (TcType, TcKind) | (f args, result kind) |
Applies a type to a list of arguments. Always consumes all the arguments.
:: Outputable fun | |
=> fun | the function |
-> TcKind | function kind (zonked) |
-> Maybe (VarEnv Kind) | possibly, kind info (see above) |
-> [LHsType Name] | args |
-> TcM (TcKind, [TcType], [LHsType Name], Int) | (result kind, typechecked args, untypechecked args, n) |
Apply a type of a given kind to a list of arguments. This instantiates
invisible parameters as necessary. However, it does *not* necessarily
apply all the arguments, if the kind runs out of binders.
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.
This version will instantiate all invisible arguments left over after
the visible ones.
solveEqualities :: TcM a -> TcM a Source
Type-check a thing that emits only equality constraints, then solve those constraints. Emits errors -- but does not fail -- if there is trouble.
kindGeneralize :: TcType -> TcM [KindVar] Source
tcHsPatSigType :: UserTypeCtxt -> LHsSigWcType Name -> TcM (Type, [TcTyVar], [(Name, TcTyVar)]) Source
tcPatSig :: Bool -> LHsSigWcType Name -> ExpSigmaType -> TcM (TcType, [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.