ghc-9.10.3: The GHC API

Safe Haskell | None
Language | GHC2021

GHC.Hs.Syn.Type

Contents

- Extracting types from HsExpr
- Extracting types from HsSyn

Description

Compute the `Type` of an ``HsExpr` `GhcTc`` in a pure fashion.

Note that this does not currently support the use case of annotating every subexpression in an `HsExpr` with its `Type`. For more information on this task, see #12706, #15320, #16804, and #17331.

Synopsis

- lhsExprType :: LHsExpr GhcTc -> Type
- hsExprType :: HsExpr GhcTc -> Type
- hsWrapperType :: HsWrapper -> Type -> Type
- hsLitType :: forall (p :: Pass). HsLit (GhcPass p) -> Type
- hsPatType :: Pat GhcTc -> Type
- hsLPatType :: LPat GhcTc -> Type

# Extracting types from HsExpr

lhsExprType :: LHsExpr GhcTc -> Type Source #

Compute the `Type` of an ``LHsExpr` `GhcTc`` in a pure fashion.

hsExprType :: HsExpr GhcTc -> Type Source #

Compute the `Type` of an ``HsExpr` `GhcTc`` in a pure fashion.

hsWrapperType :: HsWrapper -> Type -> Type Source #

# Extracting types from HsSyn

hsLitType :: forall (p :: Pass). HsLit (GhcPass p) -> Type Source #

hsPatType :: Pat GhcTc -> Type Source #

hsLPatType :: LPat GhcTc -> Type Source #