HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

Moduleghc-9.10.3GHC2021

GHC.Hs.Extension

  • 7 types
  • 1 class
  • 3 values
  • Packageghc-9.10.3
  • Exports13
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourceExtension.hs
datadata GhcPass (c :: Pass) where
#

Used as a data type index for the hsSyn AST; also serves as a singleton type for Pass

Instances1206CvtFlag, Eq, CollectPass, MapXRec, UnXRec, OutputableBndr, …
classclass (NoGhcTcPass (NoGhcTcPass p) ~ NoGhcTcPass p, IsPass (NoGhcTcPass p)) => IsPass (p :: Pass) where
#

Allows us to check what phase we're in at GHC's runtime. For example, this class allows us to write > f :: forall p. IsPass p => HsExpr (GhcPass p) -> blah > f e = case ghcPass @p of > GhcPs -> ... in this RHS we have HsExpr GhcPs... > GhcRn -> ... in this RHS we have HsExpr GhcRn... > GhcTc -> ... in this RHS we have HsExpr GhcTc... which is very useful, for example, when pretty-printing. See Note [IsPass].

Methods

Instances3IsPass

Orphan instances

2 instances