ghc-lib-parser-8.10.2.20200916: The GHC API, decoupled from GHC versions

Safe HaskellNone
LanguageHaskell2010

TyCoPpr

Contents

Description

Pretty-printing types and coercions.

Synopsis

Precedence

newtype PprPrec Source #

A general-purpose pretty-printing precedence type.

Constructors

PprPrec Int 
Instances
Eq PprPrec Source # 
Instance details

Defined in BasicTypes

Methods

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

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

Ord PprPrec Source # 
Instance details

Defined in BasicTypes

Show PprPrec Source # 
Instance details

Defined in BasicTypes

Pretty-printing types

pprUserForAll :: [TyCoVarBinder] -> SDoc Source #

Print a user-level forall; see Note [When to print foralls] in this module.

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 TcErrors.

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.

Pretty-printing TyThings