ghc-lib-0.20190204: The GHC API, decoupled from GHC versions

Safe HaskellNone
LanguageHaskell2010

TcValidity

Documentation

data Rank Source #

Instances
Instance details

Defined in TcValidity

Methods

ppr :: Rank -> SDoc Source #

pprPrec :: Rational -> Rank -> SDoc Source #

data UserTypeCtxt Source #

Constructors

checkValidType :: UserTypeCtxt -> Type -> TcM () Source #

checkValidMonoType :: Type -> TcM () Source #

checkValidTheta :: UserTypeCtxt -> ThetaType -> TcM () Source #

checkValidInstance :: UserTypeCtxt -> LHsSigType GhcRn -> Type -> TcM () Source #

checkValidInstHead :: UserTypeCtxt -> Class -> [Type] -> TcM () Source #

validDerivPred :: TyVarSet -> PredType -> Bool Source #

checkTySynRhs :: UserTypeCtxt -> TcType -> TcM () Source #

checkValidCoAxiom :: CoAxiom Branched -> TcM () Source #

checkValidCoAxBranch :: TyCon -> CoAxBranch -> TcM () Source #

checkValidTyFamEqn Source #

Arguments

:: TyCon

of the type family

-> [Var]

Bound variables in the equation

-> [Type]

Type patterns

-> Type

Rhs

-> TcM ()

Do validity checks on a type family equation, including consistency with any enclosing class instance head, termination, and lack of polytypes.

checkConsistentFamInst Source #

Arguments

-> TyCon

Family tycon

-> TcM ()

badATErr :: Name -> Name -> SDoc Source #

arityErr :: Outputable a => SDoc -> a -> Int -> Int -> SDoc Source #

checkValidTelescope :: TyCon -> TcM () Source #

Check a list of binders to see if they make a valid telescope. The key property we're checking for is scoping. For example: > data SameKind :: k -> k -> * > data X a k (b :: k) (c :: SameKind a b) Kind inference says that a's kind should be k. But that's impossible, because k isn't in scope when a is bound. This check has to come before general validity checking, because once we kind-generalise, this sort of problem is harder to spot (as we'll generalise over the unbound k in a's type.)

See Note [Generalisation for type constructors] in TcTyClsDecls for data type declarations and Note [Keeping scoped variables in order: Explicit] in TcHsType for foralls

allDistinctTyVars :: TyVarSet -> [KindOrType] -> Bool Source #

AltStyle によって変換されたページ (->オリジナル) /