ghc-8.8.1: The GHC API
Safe HaskellNone
LanguageHaskell2010

TcValidity

Synopsis

Documentation

data Rank Source #

Instances

Instances details
Outputable Rank Source # 
Instance details

Defined in TcValidity

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

:: AssocInstInfo 
-> TyCon

Family tycon

-> CoAxBranch 
-> TcM () 

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