ghc-9.12.0.20241114: The GHC API
Safe HaskellNone
LanguageGHC2021

GHC.Core.TyCo.Ppr

Description

Pretty-printing types and coercions.

Synopsis

Precedence

newtype PprPrec Source #

A general-purpose pretty-printing precedence type.

Constructors

PprPrec Int 

Instances

Instances details
Show PprPrec Source # 
Instance details

Defined in GHC.Types.Basic

Eq PprPrec Source # 
Instance details

Defined in GHC.Types.Basic

Methods

(==) :: PprPrec -> PprPrec -> Bool #

(/=) :: PprPrec -> PprPrec -> Bool #

Ord PprPrec Source # 
Instance details

Defined in GHC.Types.Basic

Pretty-printing types

pprUserForAll :: [ForAllTyBinder] -> SDoc Source #

Print a user-level forall; see Note [When to print foralls] in GHC.Iface.Type.

pprWithInvisibleBitsWhen :: Bool -> SDoc -> SDoc Source #

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]

pprWithTYPE :: Type -> SDoc Source #

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

pprSourceTyCon :: TyCon -> SDoc Source #

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

debugPprType :: Type -> SDoc Source #

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.