HORIZON HASKELLDocslts/ghc-10.0.x77a86622026-10-31Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 77a8662 · 2026-10-31

Moduleghc-10.0.0.20260917GHC2024

GHC.Core.TyCo.Ppr

Pretty-printing types and coercions.

Contents
  1. Precedence
  2. Pretty-printing types
  3. Pretty-printing coercions
Synopsis

Precedence

newtypenewtype PprPrec

A general-purpose pretty-printing precedence type.

Constructors

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

Pretty-printing types

valuepprWithTYPE :: Type -> SDoc

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

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

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.