HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleghc-9.10.3GHC2021

GHC.Core.TyCo.Ppr

Pretty-printing types and coercions.

  • 1 type
  • 33 values
  • Packageghc-9.10.3
  • Exports34
  • LanguageGHC2021
  • LicenceBSD-3-Clause
  • SourcePpr.hs

Precedence

7 declarations
newtypenewtype PprPrec
#

A general-purpose pretty-printing precedence type.

Constructors

Instances3Eq, Ord, Show
  • Eq PprPrecDefined in ghc-9.10.3 · GHC.Types.Basic
  • Ord PprPrecDefined in ghc-9.10.3 · GHC.Types.Basic
  • Show PprPrecDefined in ghc-9.10.3 · GHC.Types.Basic

Pretty-printing types

24 declarations

Display all foralls, runtime-reps, and kind information when provided Bool argument is True. See GHC.Tc.Errors.Ppr Note [Showing invisible bits of types in error messages]

valuepprWithTYPE :: Type -> SDoc
#

This variant preserves any use of TYPE in a type, effectively locally setting -fprint-explicit-runtime-reps.

valuepprSourceTyCon :: TyCon -> SDoc
#

Pretty prints a TyCon, using the family instance in case of a representation tycon. For example:

data T [a] = ...

In that case we want to print T [a], where T is the family TyCon

Pretty-printing coercions

3 declarations
valuedebugPprType :: Type -> SDoc
#

debugPprType is a simple pretty printer that prints a type without going through IfaceType. It does not format as prettily as the normal route, but it's much more direct, and that can be useful for debugging. E.g. with -dppr-debug it prints the kind on type-variable occurrences which the normal route fundamentally cannot do.