Note [splitHsApps]
The key function
splitHsApps :: HsExpr GhcRn -> (HsExpr GhcRn, HsExpr GhcRn, [HsExprArg 'TcpRn])
takes apart either an HsApp, or an infix OpApp, returning
* The "head" of the application, an expression that is often a variable;
this is used for typechecking
* The "user head" or "error head" of the application, to be reported to the
user in case of an error. Example:
(`op` e)
expands (via ExpandedThingRn) to
(rightSection op e)
but we don't want to see 'rightSection' in error messages. So we keep the
innermost un-expanded head as the "error head".
* A list of HsExprArg, the arguments References 0
This Note does not link to any other.
Referenced by 2
- Expanding HsDo with XXExprGhcRn GHC.Tc.Gen.Do
- GHC.Tc.Gen.Head call site