ghc-9.8.0.20230919: The GHC API
Safe HaskellNone
LanguageHaskell2010

GHC.Tc.Gen.Head

Synopsis

Documentation

data HsExprArg (p :: TcPass) Source #

Constructors

EValArg 

Fields

ETypeArg 

Fields

EPrag AppCtxt (HsPragE (GhcPass (XPass p))) 
EWrap EWrap 

Instances

Instances details
OutputableBndrId (XPass p) => Outputable (HsExprArg p) Source # 
Instance details

Defined in GHC.Tc.Gen.Head

Methods

ppr :: HsExprArg p -> SDoc Source #

data EValArg (p :: TcPass) where Source #

Constructors

ValArg :: forall (p :: TcPass). LHsExpr (GhcPass (XPass p)) -> EValArg p 
ValArgQL 

Fields

Instances

Instances details
OutputableBndrId (XPass p) => Outputable (EValArg p) Source # 
Instance details

Defined in GHC.Tc.Gen.Head

Methods

ppr :: EValArg p -> SDoc Source #

data TcPass Source #

Constructors

TcpRn 
TcpInst 
TcpTc 

data AppCtxt Source #

Instances

Instances details
Outputable AppCtxt Source # 
Instance details

Defined in GHC.Tc.Gen.Head

Methods

ppr :: AppCtxt -> SDoc Source #

rebuildHsApps Source #

Arguments

:: HsExpr GhcTc

the function being applied

-> AppCtxt 
-> [HsExprArg 'TcpTc]

the arguments to the function

-> TcRhoType

result type of the application

-> TcM (HsExpr GhcTc) 

Rebuild an application: takes a type-checked application head expression together with arguments in the form of typechecked HsExprArgs and returns a typechecked application of the head to the arguments.

This performs a representation-polymorphism check to ensure that the remaining value arguments in an application have a fixed RuntimeRep.

See Note [Checking for representation-polymorphic built-ins].

isHsValArg :: forall (id :: TcPass). HsExprArg id -> Bool Source #

countLeadingValArgs :: forall (id :: TcPass). [HsExprArg id] -> Int Source #

isVisibleArg :: forall (id :: TcPass). HsExprArg id -> Bool Source #

countVisAndInvisValArgs :: forall (id :: TcPass). [HsExprArg id] -> Arity Source #

Count visible and invisible value arguments in a list of HsExprArg arguments.

countHsWrapperInvisArgs :: HsWrapper -> Arity Source #

Counts the number of invisible term-level arguments applied by an HsWrapper. Precondition: this wrapper contains no abstractions.