ghc-9.10.0.20240426: 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.

pprWithExplicitKindsWhen :: Bool -> SDoc -> SDoc Source #

Display all kind information (with -fprint-explicit-kinds) when the provided Bool argument is True. See Note [Kind arguments in error messages] in GHC.Tc.Errors.

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.