ghc-9.8.0.20230919: The GHC API
Safe HaskellNone
LanguageHaskell2010

GHC.Tc.Gen.HsType

Description

Typechecking user-specified MonoTypes

Synopsis

Documentation

addSigCtxt :: Outputable hs_ty => UserTypeCtxt -> LocatedA hs_ty -> TcM a -> TcM a Source #

tcDerivStrategy Source #

Arguments

:: Maybe (LDerivStrategy GhcRn)

The deriving strategy

-> TcM (Maybe (LDerivStrategy GhcTc), [TcTyVar])

The typechecked deriving strategy and the tyvars that it binds (if using ViaStrategy).

Typecheck a deriving strategy. For most deriving strategies, this is a no-op, but for the via strategy, this requires typechecking the via type.

tcHsTypeApp :: LHsWcType GhcRn -> Kind -> TcM Type Source #

Type-check a visible type application

bindExplicitTKBndrs_Skol :: OutputableBndrFlag flag 'Renamed => SkolemInfo -> [LHsTyVarBndr flag GhcRn] -> TcM a -> TcM ([VarBndr TyVar flag], a) Source #

Skolemise the HsTyVarBndrs in an HsForAllTelescope with the supplied TcTyMode.

bindTyClTyVars :: Name -> ([TcTyConBinder] -> TcKind -> TcM a) -> TcM a Source #

Bring into scope the binders of a PolyTcTyCon Used for the type variables of a type or class decl in the "kind checking" and "type checking" pass, but not in the initial-kind run.

data SAKS_or_CUSK Source #

Constructors

SAKS Kind 
CUSK 

Instances

Instances details
Outputable SAKS_or_CUSK Source # 
Instance details

Defined in GHC.Tc.Gen.HsType

data ContextKind Source #

Describes the kind expected in a certain context.

Constructors

TheKind TcKind

a specific kind

AnyKind

any kind will do

OpenKind

something of the form TYPE _

kcDeclHeader Source #

Arguments

:: InitialKindStrategy 
-> Name

of the thing being checked

-> TyConFlavour TyCon

What sort of TyCon is being checked

-> LHsQTyVars GhcRn

Binders in the header

-> TcM ContextKind

The result kind

-> TcM TcTyCon

A suitably-kinded TcTyCon

kindGeneralizeAll :: SkolemInfo -> TcType -> TcM [KindVar] Source #

  • Specialised version of kindGeneralizeSome, but with empty WantedConstraints, so no filtering is needed i.e. kindGeneraliseAll = kindGeneralizeSome emptyWC

checkDataKindSig :: DataSort -> Kind -> TcM () Source #

Checks that the return kind in a data declaration's kind signature is permissible. There are three cases:

If dealing with a data, newtype, data instance, or newtype instance declaration, check that the return kind is Type.

If the declaration is a newtype or newtype instance and the UnliftedNewtypes extension is enabled, this check is slightly relaxed so that a return kind of the form TYPE r (for some r) is permitted. See Note [Implementation of UnliftedNewtypes] in GHC.Tc.TyCl.

If dealing with a data family declaration, check that the return kind is either of the form:

  1. TYPE r (for some r), or
  2. k (where k is a bare kind variable; see #12369)

See also Note [Datatype return kinds] in GHC.Tc.TyCl

data DataSort Source #

A description of whether something is a

At present, this data type is only consumed by checkDataKindSig.

checkClassKindSig :: Kind -> TcM () Source #

Checks that the result kind of a class is exactly Constraint, rejecting type synonyms and type families that reduce to Constraint. See #16826.

data HoleMode Source #

Instances

Instances details
Outputable HoleMode Source # 
Instance details

Defined in GHC.Tc.Gen.HsType

Methods

ppr :: HoleMode -> SDoc 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.

addTyConFlavCtxt :: Name -> TyConFlavour tc -> TcM a -> TcM a Source #

Add a "In the data declaration for T" or some such.