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

Safe HaskellNone
LanguageHaskell2010

Outputable

Contents

Description

This module defines classes and functions for pretty-printing. It also exports a number of helpful debugging and other utilities such as trace and panic.

The interface to this module is very similar to the standard Hughes-PJ pretty printing module, except that it exports a number of additional functions that are rarely used, and works over the SDoc type.

Synopsis

Type classes

class Outputable a where Source #

Class designating that some type has an SDoc representation

Minimal complete definition

Nothing

Methods

ppr :: a -> SDoc Source #

pprPrec :: Rational -> a -> SDoc Source #

Instances
Outputable Bool Source # 
Instance details

Defined in Outputable

Outputable Char Source # 
Instance details

Defined in Outputable

Outputable Double Source # 
Instance details

Defined in Outputable

Outputable Float Source # 
Instance details

Defined in Outputable

Outputable Int Source # 
Instance details

Defined in Outputable

Methods

ppr :: Int -> SDoc Source #

pprPrec :: Rational -> Int -> SDoc Source #

Outputable Int32 Source # 
Instance details

Defined in Outputable

Outputable Int64 Source # 
Instance details

Defined in Outputable

Outputable Integer Source # 
Instance details

Defined in Outputable

Outputable Ordering Source # 
Instance details

Defined in Outputable

Outputable Word Source # 
Instance details

Defined in Outputable

Outputable Word16 Source # 
Instance details

Defined in Outputable

Outputable Word32 Source # 
Instance details

Defined in Outputable

Outputable () Source # 
Instance details

Defined in Outputable

Methods

ppr :: () -> SDoc Source #

pprPrec :: Rational -> () -> SDoc Source #

Outputable Fingerprint Source # 
Instance details

Defined in Outputable

Outputable Extension Source # 
Instance details

Defined in Outputable

Outputable Serialized Source # 
Instance details

Defined in Outputable

Outputable Delta Source # 
Instance details

Defined in GHC.HsToCore.PmCheck.Types

Outputable Name Source # 
Instance details

Defined in Name

Outputable OccName Source # 
Instance details

Defined in OccName

Outputable SDoc Source # 
Instance details

Defined in Outputable

Outputable PrimOp Source # 
Instance details

Defined in PrimOp

Outputable TyCon Source # 
Instance details

Defined in TyCon

Outputable FastString Source # 
Instance details

Defined in Outputable

Outputable ComponentId Source # 
Instance details

Defined in Module

Outputable InstalledUnitId Source # 
Instance details

Defined in Module

Outputable UnitId Source # 
Instance details

Defined in Module

Outputable ModuleName Source # 
Instance details

Defined in Module

Outputable Module Source # 
Instance details

Defined in Module

Outputable QualifyName Source # 
Instance details

Defined in Outputable

Outputable PprStyle Source # 
Instance details

Defined in Outputable

Outputable TcTyVarDetails Source # 
Instance details

Defined in TcType

Outputable MetaDetails Source # 
Instance details

Defined in TcType

Outputable SrcSpan Source # 
Instance details

Defined in SrcLoc

Outputable RealSrcSpan Source # 
Instance details

Defined in SrcLoc

Outputable SrcLoc Source # 
Instance details

Defined in SrcLoc

Outputable RealSrcLoc Source # 
Instance details

Defined in SrcLoc

Outputable IdDetails Source # 
Instance details

Defined in IdInfo

Outputable TypeOrKind Source # 
Instance details

Defined in BasicTypes

Outputable IntWithInf Source # 
Instance details

Defined in BasicTypes

Outputable FractionalLit Source # 
Instance details

Defined in BasicTypes

Outputable IntegralLit Source # 
Instance details

Defined in BasicTypes

Outputable InlineSpec Source # 
Instance details

Defined in BasicTypes

Outputable InlinePragma Source # 
Instance details

Defined in BasicTypes

Outputable RuleMatchInfo Source # 
Instance details

Defined in BasicTypes

Outputable Activation Source # 
Instance details

Defined in BasicTypes

Outputable CompilerPhase Source # 
Instance details

Defined in BasicTypes

Outputable SourceText Source # 
Instance details

Defined in BasicTypes

Outputable SuccessFlag Source # 
Instance details

Defined in BasicTypes

Outputable TailCallInfo Source # 
Instance details

Defined in BasicTypes

Outputable OccInfo Source # 
Instance details

Defined in BasicTypes

Outputable TupleSort Source # 
Instance details

Defined in BasicTypes

Outputable OverlapMode Source # 
Instance details

Defined in BasicTypes

Outputable OverlapFlag Source # 
Instance details

Defined in BasicTypes

Outputable Origin Source # 
Instance details

Defined in BasicTypes

Outputable RecFlag Source # 
Instance details

Defined in BasicTypes

Outputable Boxity Source # 
Instance details

Defined in BasicTypes

Outputable TopLevelFlag Source # 
Instance details

Defined in BasicTypes

Outputable LexicalFixity Source # 
Instance details

Defined in BasicTypes

Outputable FixityDirection Source # 
Instance details

Defined in BasicTypes

Outputable Fixity Source # 
Instance details

Defined in BasicTypes

Outputable WarningTxt Source # 
Instance details

Defined in BasicTypes

Outputable StringLiteral Source # 
Instance details

Defined in BasicTypes

Outputable FunctionOrData Source # 
Instance details

Defined in BasicTypes

Outputable SwapFlag Source # 
Instance details

Defined in BasicTypes

Outputable OneShotInfo Source # 
Instance details

Defined in BasicTypes

Outputable Alignment Source # 
Instance details

Defined in BasicTypes

Outputable LeftOrRight Source # 
Instance details

Defined in BasicTypes

Outputable Unique Source # 
Instance details

Defined in Unique

Outputable DefUnitId Source # 
Instance details

Defined in Module

Outputable InstalledModule Source # 
Instance details

Defined in Module

Outputable IndefModule Source # 
Instance details

Defined in Module

Outputable IndefUnitId Source # 
Instance details

Defined in Module

Outputable ModLocation Source # 
Instance details

Defined in Module

Outputable PackageName Source # 
Instance details

Defined in PackageConfig

Outputable SourcePackageId Source # 
Instance details

Defined in PackageConfig

Outputable CType Source # 
Instance details

Defined in ForeignCall

Outputable Header Source # 
Instance details

Defined in ForeignCall

Outputable CCallConv Source # 
Instance details

Defined in ForeignCall

Outputable CCallSpec Source # 
Instance details

Defined in ForeignCall

Outputable CExportSpec Source # 
Instance details

Defined in ForeignCall

Outputable Safety Source # 
Instance details

Defined in ForeignCall

Outputable ForeignCall Source # 
Instance details

Defined in ForeignCall

Outputable Phase Source # 
Instance details

Defined in DriverPhases

Outputable EdgeType Source # 
Instance details

Defined in Digraph

Outputable WarnReason Source # 
Instance details

Defined in CmdLineParser

Outputable PackageFlag Source # 
Instance details

Defined in DynFlags

Outputable ModRenaming Source # 
Instance details

Defined in DynFlags

Outputable PackageArg Source # 
Instance details

Defined in DynFlags

Outputable GhcMode Source # 
Instance details

Defined in DynFlags

Outputable SafeHaskellMode Source # 
Instance details

Defined in DynFlags

Outputable Language Source # 
Instance details

Defined in DynFlags

Outputable WarnReason Source # 
Instance details

Defined in DynFlags

Outputable CoreToDo Source # 
Instance details

Defined in CoreMonad

Outputable Width Source # 
Instance details

Defined in CmmType

Outputable CmmType Source # 
Instance details

Defined in CmmType

Outputable Var Source # 
Instance details

Defined in Var

Methods

ppr :: Var -> SDoc Source #

pprPrec :: Rational -> Var -> SDoc Source #

Outputable AnonArgFlag Source # 
Instance details

Defined in Var

Outputable ArgFlag Source # 
Instance details

Defined in Var

Outputable MCoercion Source # 
Instance details

Defined in TyCoRep

Outputable TyCoBinder Source # 
Instance details

Defined in TyCoRep

Outputable TyLit Source # 
Instance details

Defined in TyCoRep

Outputable UnivCoProvenance Source # 
Instance details

Defined in TyCoRep

Outputable Coercion Source # 
Instance details

Defined in TyCoRep

Outputable TyThing Source # 
Instance details

Defined in TyCoRep

Outputable Type Source # 
Instance details

Defined in TyCoRep

Outputable UnusablePackageReason Source # 
Instance details

Defined in Packages

Outputable ModuleOrigin Source # 
Instance details

Defined in Packages

Outputable ArgDocMap Source # 
Instance details

Defined in GHC.Hs.Doc

Outputable DeclDocMap Source # 
Instance details

Defined in GHC.Hs.Doc

Outputable HsDocString Source # 
Instance details

Defined in GHC.Hs.Doc

Outputable AvailInfo Source # 
Instance details

Defined in Avail

Outputable ImportSpec Source # 
Instance details

Defined in RdrName

Outputable Parent Source # 
Instance details

Defined in RdrName

Outputable GlobalRdrElt Source # 
Instance details

Defined in RdrName

Outputable LocalRdrEnv Source # 
Instance details

Defined in RdrName

Outputable RdrName Source # 
Instance details

Defined in RdrName

Outputable AnnotationComment Source # 
Instance details

Defined in ApiAnnotation

Outputable AnnKeywordId Source # 
Instance details

Defined in ApiAnnotation

Outputable Token Source # 
Instance details

Defined in Lexer

Outputable Annotation Source # 
Instance details

Defined in Annotations

Outputable ForallVisFlag Source # 
Instance details

Defined in Var

Outputable PatSyn Source # 
Instance details

Defined in PatSyn

Outputable IfaceBndr Source # 
Instance details

Defined in IfaceType

Outputable IfaceCoercion Source # 
Instance details

Defined in IfaceType

Outputable IfaceTyLit Source # 
Instance details

Defined in IfaceType

Outputable IfaceTyCon Source # 
Instance details

Defined in IfaceType

Outputable IfaceType Source # 
Instance details

Defined in IfaceType

Outputable IfaceAppArgs Source # 
Instance details

Defined in IfaceType

Outputable NoExtCon Source # 
Instance details

Defined in GHC.Hs.Extension

Outputable NoExtField Source # 
Instance details

Defined in GHC.Hs.Extension

Outputable EqSpec Source # 
Instance details

Defined in DataCon

Outputable DataCon Source # 
Instance details

Defined in DataCon

Outputable ConLike Source # 
Instance details

Defined in ConLike

Outputable CostCentreStack Source # 
Instance details

Defined in CostCentre

Outputable CostCentre Source # 
Instance details

Defined in CostCentre

Outputable CoAxiomRule Source # 
Instance details

Defined in CoAxiom

Outputable Role Source # 
Instance details

Defined in CoAxiom

Outputable CoAxBranch Source # 
Instance details

Defined in CoAxiom

Outputable LiftingContext Source # 
Instance details

Defined in Coercion

Outputable Class Source # 
Instance details

Defined in Class

Outputable InScopeSet Source # 
Instance details

Defined in VarEnv

Outputable TyConFlavour Source # 
Instance details

Defined in TyCon

Outputable PrimElemRep Source # 
Instance details

Defined in TyCon

Outputable PrimRep Source # 
Instance details

Defined in TyCon

Outputable FamTyConFlav Source # 
Instance details

Defined in TyCon

Outputable AlgTyConFlav Source # 
Instance details

Defined in TyCon

Outputable TyConBndrVis Source # 
Instance details

Defined in TyCon

Outputable CoercionHole Source # 
Instance details

Defined in TyCoRep

Outputable TCvSubst Source # 
Instance details

Defined in TyCoSubst

Outputable Literal Source # 
Instance details

Defined in Literal

Outputable OverLitVal Source # 
Instance details

Defined in GHC.Hs.Lit

Outputable EqRel Source # 
Instance details

Defined in Predicate

Outputable StrictnessMark Source # 
Instance details

Defined in DataCon

Outputable SrcUnpackedness Source # 
Instance details

Defined in DataCon

Outputable SrcStrictness Source # 
Instance details

Defined in DataCon

Outputable HsImplBang Source # 
Instance details

Defined in DataCon

Outputable HsSrcBang Source # 
Instance details

Defined in DataCon

Outputable SlotTy Source # 
Instance details

Defined in RepType

Outputable StrictSig Source # 
Instance details

Defined in Demand

Outputable DmdType Source # 
Instance details

Defined in Demand

Outputable CPRResult Source # 
Instance details

Defined in Demand

Outputable TypeShape Source # 
Instance details

Defined in Demand

Outputable Count Source # 
Instance details

Defined in Demand

Outputable UseDmd Source # 
Instance details

Defined in Demand

Outputable StrDmd Source # 
Instance details

Defined in Demand

Outputable UnfoldingGuidance Source # 
Instance details

Defined in PprCore

Outputable UnfoldingSource Source # 
Instance details

Defined in PprCore

Outputable Unfolding Source # 
Instance details

Defined in PprCore

Outputable CoreRule Source # 
Instance details

Defined in PprCore

Outputable AltCon Source # 
Instance details

Defined in CoreSyn

Outputable LevityInfo Source # 
Instance details

Defined in IdInfo

Outputable TickBoxOp Source # 
Instance details

Defined in IdInfo

Outputable CafInfo Source # 
Instance details

Defined in IdInfo

Outputable RecSelParent Source # 
Instance details

Defined in IdInfo

Outputable ShowHowMuch Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceJoinInfo Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceConAlt Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceExpr Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceIdDetails Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceUnfolding Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceInfoItem Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceIdInfo Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceCompleteMatch Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceAnnotation Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceRule Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceFamInst Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceClsInst Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceAT Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceClassOp Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceTyConParent Source # 
Instance details

Defined in IfaceSyn

Outputable IfaceDecl Source # 
Instance details

Defined in IfaceSyn

Outputable PrimCall Source # 
Instance details

Defined in PrimOp

Outputable HsTyLit Source # 
Instance details

Defined in GHC.Hs.Types

Outputable NewHsTypeX Source # 
Instance details

Defined in GHC.Hs.Types

Outputable HsIPName Source # 
Instance details

Defined in GHC.Hs.Types

Outputable CgBreakInfo Source # 
Instance details

Defined in ByteCodeTypes

Outputable UnlinkedBCO Source # 
Instance details

Defined in ByteCodeTypes

Outputable CompiledByteCode Source # 
Instance details

Defined in ByteCodeTypes

Outputable SptEntry Source # 
Instance details

Defined in LinkerTypes

Outputable Unlinked Source # 
Instance details

Defined in LinkerTypes

Outputable Linkable Source # 
Instance details

Defined in LinkerTypes

Outputable CoreStats Source # 
Instance details

Defined in CoreStats

Outputable FamInstMatch Source # 
Instance details

Defined in FamInstEnv

Outputable FamInst Source # 
Instance details

Defined in FamInstEnv

Outputable TcLevel Source # 
Instance details

Defined in TcType

Outputable MetaInfo Source # 
Instance details

Defined in TcType

Outputable InferResult Source # 
Instance details

Defined in TcType

Outputable ExpType Source # 
Instance details

Defined in TcType

Outputable ClsInst Source # 
Instance details

Defined in InstEnv

Outputable EvCallStack Source # 
Instance details

Defined in TcEvidence

Outputable EvTypeable Source # 
Instance details

Defined in TcEvidence

Outputable EvTerm Source # 
Instance details

Defined in TcEvidence

Outputable EvBind Source # 
Instance details

Defined in TcEvidence

Outputable EvBindMap Source # 
Instance details

Defined in TcEvidence

Outputable EvBindsVar Source # 
Instance details

Defined in TcEvidence

Outputable TcEvBinds Source # 
Instance details

Defined in TcEvidence

Outputable HsWrapper Source # 
Instance details

Defined in TcEvidence

Outputable TcSpecPrag Source # 
Instance details

Defined in GHC.Hs.Binds

Outputable DocDecl Source # 
Instance details

Defined in GHC.Hs.Decls

Outputable ForeignExport Source # 
Instance details

Defined in GHC.Hs.Decls

Outputable ForeignImport Source # 
Instance details

Defined in GHC.Hs.Decls

Outputable NewOrData Source # 
Instance details

Defined in GHC.Hs.Decls

Outputable PendingTcSplice Source # 
Instance details

Defined in GHC.Hs.Expr

Outputable PendingRnSplice Source # 
Instance details

Defined in GHC.Hs.Expr

Outputable SpliceDecoration Source # 
Instance details

Defined in GHC.Hs.Expr

Outputable UnboundVar Source # 
Instance details

Defined in GHC.Hs.Expr

Outputable CtOrigin Source # 
Instance details

Defined in TcOrigin

Outputable SkolemInfo Source # 
Instance details

Defined in TcOrigin

Outputable TyEl Source # 
Instance details

Defined in RdrHsSyn

Outputable CompleteMatch Source # 
Instance details

Defined in HscTypes

Outputable IfaceTrustInfo Source # 
Instance details

Defined in HscTypes

Outputable ModSummary Source # 
Instance details

Defined in HscTypes

Outputable FixItem Source # 
Instance details

Defined in HscTypes

Outputable InteractiveImport Source # 
Instance details

Defined in HscTypes

Outputable TargetId Source # 
Instance details

Defined in HscTypes

Outputable Target Source # 
Instance details

Defined in HscTypes

Outputable PhasePlus Source # 
Instance details

Defined in PipelineMonad

Outputable Tick Source # 
Instance details

Defined in CoreMonad

Outputable FloatOutSwitches Source # 
Instance details

Defined in CoreMonad

Outputable SimplMode Source # 
Instance details

Defined in CoreMonad

Outputable HsComponentId Source # 
Instance details

Defined in BkpSyn

Outputable FloatBind Source # 
Instance details

Defined in MkCore

Outputable TyState Source #

Not user-facing.

Instance details

Defined in GHC.HsToCore.PmCheck.Types

Outputable VarInfo Source #

Not user-facing.

Instance details

Defined in GHC.HsToCore.PmCheck.Types

Outputable TmState Source #

Not user-facing.

Instance details

Defined in GHC.HsToCore.PmCheck.Types

Outputable PossibleMatches Source # 
Instance details

Defined in GHC.HsToCore.PmCheck.Types

Outputable PmAltCon Source # 
Instance details

Defined in GHC.HsToCore.PmCheck.Types

Outputable PmEquality Source # 
Instance details

Defined in GHC.HsToCore.PmCheck.Types

Outputable PmLitValue Source # 
Instance details

Defined in GHC.HsToCore.PmCheck.Types

Outputable PmLit Source # 
Instance details

Defined in GHC.HsToCore.PmCheck.Types

Outputable Subst Source # 
Instance details

Defined in CoreSubst

Outputable CallCtxt Source # 
Instance details

Defined in CoreUnfold

Outputable ArgSummary Source # 
Instance details

Defined in CoreUnfold

Outputable SubGoalDepth Source # 
Instance details

Defined in Constraint

Outputable CtFlavour Source # 
Instance details

Defined in Constraint

Outputable CtEvidence Source # 
Instance details

Defined in Constraint

Outputable TcEvDest Source # 
Instance details

Defined in Constraint

Outputable ImplicStatus Source # 
Instance details

Defined in Constraint

Outputable Implication Source # 
Instance details

Defined in Constraint

Outputable WantedConstraints Source # 
Instance details

Defined in Constraint

Outputable Hole Source # 
Instance details

Defined in Constraint

Outputable QCInst Source # 
Instance details

Defined in Constraint

Outputable Ct Source # 
Instance details

Defined in Constraint

Methods

ppr :: Ct -> SDoc Source #

pprPrec :: Rational -> Ct -> SDoc Source #

Outputable TcPatSynInfo Source # 
Instance details

Defined in TcRnTypes

Outputable TcIdSigInst Source # 
Instance details

Defined in TcRnTypes

Outputable TcIdSigInfo Source # 
Instance details

Defined in TcRnTypes

Outputable TcSigInfo Source # 
Instance details

Defined in TcRnTypes

Outputable WhereFrom Source # 
Instance details

Defined in TcRnTypes

Outputable IdBindingInfo Source # 
Instance details

Defined in TcRnTypes

Outputable PromotionErr Source # 
Instance details

Defined in TcRnTypes

Outputable TcTyThing Source # 
Instance details

Defined in TcRnTypes

Outputable ThStage Source # 
Instance details

Defined in TcRnTypes

Outputable TcBinder Source # 
Instance details

Defined in TcRnTypes

Outputable HoleFit Source # 
Instance details

Defined in TcHoleFitTypes

Outputable HoleFitCandidate Source # 
Instance details

Defined in TcHoleFitTypes

Outputable TypedHole Source # 
Instance details

Defined in TcHoleFitTypes

Outputable PluginRecompile Source # 
Instance details

Defined in Plugins

Outputable a => Outputable [a] Source # 
Instance details

Defined in Outputable

Methods

ppr :: [a] -> SDoc Source #

pprPrec :: Rational -> [a] -> SDoc Source #

Outputable a => Outputable (Maybe a) Source # 
Instance details

Defined in Outputable

Methods

ppr :: Maybe a -> SDoc Source #

pprPrec :: Rational -> Maybe a -> SDoc Source #

Outputable elt => Outputable (IntMap elt) Source # 
Instance details

Defined in Outputable

Methods

ppr :: IntMap elt -> SDoc Source #

pprPrec :: Rational -> IntMap elt -> SDoc Source #

Outputable a => Outputable (SCC a) Source # 
Instance details

Defined in Outputable

Methods

ppr :: SCC a -> SDoc Source #

pprPrec :: Rational -> SCC a -> SDoc Source #

Outputable a => Outputable (Set a) Source # 
Instance details

Defined in Outputable

Methods

ppr :: Set a -> SDoc Source #

pprPrec :: Rational -> Set a -> SDoc Source #

Outputable a => Outputable (Pair a) Source # 
Instance details

Defined in Pair

Methods

ppr :: Pair a -> SDoc Source #

pprPrec :: Rational -> Pair a -> SDoc Source #

Outputable a => Outputable (OrdList a) Source # 
Instance details

Defined in OrdList

Outputable (DefMethSpec ty) Source # 
Instance details

Defined in BasicTypes

Outputable a => Outputable (UniqFM a) Source # 
Instance details

Defined in UniqFM

Methods

ppr :: UniqFM a -> SDoc Source #

pprPrec :: Rational -> UniqFM a -> SDoc Source #

Outputable a => Outputable (UniqSet a) Source # 
Instance details

Defined in UniqSet

Outputable a => Outputable (UniqDFM a) Source # 
Instance details

Defined in UniqDFM

Outputable a => Outputable (UniqDSet a) Source # 
Instance details

Defined in UniqDSet

OutputableBndr a => Outputable (BooleanFormula a) Source # 
Instance details

Defined in BooleanFormula

Outputable node => Outputable (Graph node) Source # 
Instance details

Defined in Digraph

Methods

ppr :: Graph node -> SDoc Source #

pprPrec :: Rational -> Graph node -> SDoc Source #

Outputable a => Outputable (Bag a) Source # 
Instance details

Defined in Bag

Methods

ppr :: Bag a -> SDoc Source #

pprPrec :: Rational -> Bag a -> SDoc Source #

Outputable a => Outputable (OccEnv a) Source # 
Instance details

Defined in OccName

Methods

ppr :: OccEnv a -> SDoc Source #

pprPrec :: Rational -> OccEnv a -> SDoc Source #

Outputable a => Outputable (FieldLbl a) Source # 
Instance details

Defined in FieldLabel

Outputable name => Outputable (AnnTarget name) Source # 
Instance details

Defined in Annotations

Methods

ppr :: AnnTarget name -> SDoc Source #

pprPrec :: Rational -> AnnTarget name -> SDoc Source #

OutputableBndrId p => Outputable (Pat (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Pat

Methods

ppr :: Pat (GhcPass p) -> SDoc Source #

pprPrec :: Rational -> Pat (GhcPass p) -> SDoc Source #

OutputableBndrId p => Outputable (IE (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.ImpExp

Methods

ppr :: IE (GhcPass p) -> SDoc Source #

pprPrec :: Rational -> IE (GhcPass p) -> SDoc Source #

OutputableBndr name => Outputable (IEWrappedName name) Source # 
Instance details

Defined in GHC.Hs.ImpExp

OutputableBndrId p => Outputable (ImportDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.ImpExp

OutputableBndrId p => Outputable (SyntaxExpr (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId p => Outputable (HsSplice (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId p => Outputable (HsCmd (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId p => Outputable (HsExpr (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Expr

Outputable (CoAxiom br) Source # 
Instance details

Defined in CoAxiom

Methods

ppr :: CoAxiom br -> SDoc Source #

pprPrec :: Rational -> CoAxiom br -> SDoc Source #

OutputableBndrId p => Outputable (HsOverLit (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Lit

Outputable (HsLit (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Lit

Outputable a => Outputable (UnifyResultM a) Source # 
Instance details

Defined in Unify

Outputable b => Outputable (TaggedBndr b) Source # 
Instance details

Defined in CoreSyn

Outputable id => Outputable (Tickish id) Source # 
Instance details

Defined in PprCore

Methods

ppr :: Tickish id -> SDoc Source #

pprPrec :: Rational -> Tickish id -> SDoc Source #

OutputableBndr b => Outputable (Bind b) Source # 
Instance details

Defined in PprCore

Methods

ppr :: Bind b -> SDoc Source #

pprPrec :: Rational -> Bind b -> SDoc Source #

OutputableBndr b => Outputable (Expr b) Source # 
Instance details

Defined in PprCore

Methods

ppr :: Expr b -> SDoc Source #

pprPrec :: Rational -> Expr b -> SDoc Source #

Outputable (AmbiguousFieldOcc (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Types

Outputable (FieldOcc pass) Source # 
Instance details

Defined in GHC.Hs.Types

Methods

ppr :: FieldOcc pass -> SDoc Source #

pprPrec :: Rational -> FieldOcc pass -> SDoc Source #

OutputableBndrId p => Outputable (ConDeclField (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Types

OutputableBndrId p => Outputable (HsType (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Types

OutputableBndrId p => Outputable (HsTyVarBndr (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Types

OutputableBndrId p => Outputable (LHsQTyVars (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Types

Outputable a => Outputable (CoreMap a) Source # 
Instance details

Defined in CoreMap

Outputable a => Outputable (RecordPatSynField a) Source # 
Instance details

Defined in GHC.Hs.Binds

OutputableBndrId p => Outputable (FixitySig (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Binds

OutputableBndrId p => Outputable (Sig (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Binds

Methods

ppr :: Sig (GhcPass p) -> SDoc Source #

pprPrec :: Rational -> Sig (GhcPass p) -> SDoc Source #

OutputableBndrId p => Outputable (IPBind (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Binds

OutputableBndrId p => Outputable (HsIPBinds (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Binds

OutputableBndrId p => Outputable (ABExport (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Binds

OutputableBndr (IdP (GhcPass p)) => Outputable (RoleAnnotDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (AnnDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndr (IdP (GhcPass p)) => Outputable (WarnDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndr (IdP (GhcPass p)) => Outputable (WarnDecls (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (RuleBndr (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (RuleDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (RuleDecls (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (ForeignDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (DefaultDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (DerivStrategy (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (DerivDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (InstDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (ClsInstDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (DataFamInstDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (TyFamInstDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (ConDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (StandaloneKindSig (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (HsDerivingClause (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (HsDataDefn (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

Outputable (FamilyInfo pass) Source # 
Instance details

Defined in GHC.Hs.Decls

Methods

ppr :: FamilyInfo pass -> SDoc Source #

pprPrec :: Rational -> FamilyInfo pass -> SDoc Source #

OutputableBndrId p => Outputable (FamilyDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (TyClGroup (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (TyClDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (SpliceDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (HsGroup (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

OutputableBndrId p => Outputable (HsDecl (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Decls

(Outputable (GhcPass p), Outputable (NameOrRdrName (GhcPass p))) => Outputable (HsStmtContext (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Expr

OutputableBndr id => Outputable (HsMatchContext id) Source # 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId p => Outputable (ArithSeqInfo (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId p => Outputable (HsBracket (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId p => Outputable (HsSplicedThing (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId idL => Outputable (ApplicativeArg (GhcPass idL)) Source # 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId p => Outputable (HsCmdTop (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Expr

OutputableBndrId p => Outputable (HsModule (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs

Outputable (PatBuilder GhcPs) Source # 
Instance details

Defined in RdrHsSyn

Outputable a => Outputable (SharedDIdEnv a) Source # 
Instance details

Defined in GHC.HsToCore.PmCheck.Types

Outputable a => Outputable (Shared a) Source # 
Instance details

Defined in GHC.HsToCore.PmCheck.Types

Methods

ppr :: Shared a -> SDoc Source #

pprPrec :: Rational -> Shared a -> SDoc Source #

(Outputable a, Outputable b) => Outputable (Either a b) Source # 
Instance details

Defined in Outputable

Methods

ppr :: Either a b -> SDoc Source #

pprPrec :: Rational -> Either a b -> SDoc Source #

(Outputable a, Outputable b) => Outputable (a, b) Source # 
Instance details

Defined in Outputable

Methods

ppr :: (a, b) -> SDoc Source #

pprPrec :: Rational -> (a, b) -> SDoc Source #

(Outputable key, Outputable elt) => Outputable (Map key elt) Source # 
Instance details

Defined in Outputable

Methods

ppr :: Map key elt -> SDoc Source #

pprPrec :: Rational -> Map key elt -> SDoc Source #

(Outputable l, Outputable e) => Outputable (GenLocated l e) Source # 
Instance details

Defined in SrcLoc

(Outputable a, Outputable b) => Outputable (Node a b) Source # 
Instance details

Defined in Digraph

Methods

ppr :: Node a b -> SDoc Source #

pprPrec :: Rational -> Node a b -> SDoc Source #

Outputable tv => Outputable (VarBndr tv ArgFlag) Source # 
Instance details

Defined in Var

OutputableBndr tv => Outputable (VarBndr tv TyConBndrVis) Source # 
Instance details

Defined in TyCon

(Outputable a, Outputable (m a)) => Outputable (GenMap m a) Source # 
Instance details

Defined in TrieMap

Methods

ppr :: GenMap m a -> SDoc Source #

pprPrec :: Rational -> GenMap m a -> SDoc Source #

(TrieMap m, Outputable a) => Outputable (ListMap m a) Source # 
Instance details

Defined in TrieMap

Methods

ppr :: ListMap m a -> SDoc Source #

pprPrec :: Rational -> ListMap m a -> SDoc Source #

(Outputable tm, Outputable ty) => Outputable (HsArg tm ty) Source # 
Instance details

Defined in GHC.Hs.Types

Methods

ppr :: HsArg tm ty -> SDoc Source #

pprPrec :: Rational -> HsArg tm ty -> SDoc Source #

(Outputable arg, Outputable rec) => Outputable (HsConDetails arg rec) Source # 
Instance details

Defined in GHC.Hs.Types

Methods

ppr :: HsConDetails arg rec -> SDoc Source #

pprPrec :: Rational -> HsConDetails arg rec -> SDoc Source #

Outputable thing => Outputable (HsWildCardBndrs (GhcPass p) thing) Source # 
Instance details

Defined in GHC.Hs.Types

Outputable thing => Outputable (HsImplicitBndrs (GhcPass p) thing) Source # 
Instance details

Defined in GHC.Hs.Types

(OutputableBndrId l, OutputableBndrId r, Outputable (XXPatSynBind (GhcPass l) (GhcPass r))) => Outputable (PatSynBind (GhcPass l) (GhcPass r)) Source # 
Instance details

Defined in GHC.Hs.Binds

(OutputableBndrId pl, OutputableBndrId pr) => Outputable (HsBindLR (GhcPass pl) (GhcPass pr)) Source # 
Instance details

Defined in GHC.Hs.Binds

(OutputableBndrId pl, OutputableBndrId pr) => Outputable (HsValBindsLR (GhcPass pl) (GhcPass pr)) Source # 
Instance details

Defined in GHC.Hs.Binds

(OutputableBndrId pl, OutputableBndrId pr) => Outputable (HsLocalBindsLR (GhcPass pl) (GhcPass pr)) Source # 
Instance details

Defined in GHC.Hs.Binds

(Outputable p, Outputable arg) => Outputable (HsRecField' p arg) Source # 
Instance details

Defined in GHC.Hs.Pat

Methods

ppr :: HsRecField' p arg -> SDoc Source #

pprPrec :: Rational -> HsRecField' p arg -> SDoc Source #

Outputable arg => Outputable (HsRecFields p arg) Source # 
Instance details

Defined in GHC.Hs.Pat

Methods

ppr :: HsRecFields p arg -> SDoc Source #

pprPrec :: Rational -> HsRecFields p arg -> SDoc Source #

(Outputable (StmtLR idL idL (LHsExpr idL)), Outputable (XXParStmtBlock idL idR)) => Outputable (ParStmtBlock idL idR) Source # 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: ParStmtBlock idL idR -> SDoc Source #

pprPrec :: Rational -> ParStmtBlock idL idR -> SDoc Source #

(OutputableBndrId pr, Outputable body) => Outputable (Match (GhcPass pr) body) Source # 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: Match (GhcPass pr) body -> SDoc Source #

pprPrec :: Rational -> Match (GhcPass pr) body -> SDoc Source #

(Outputable a, Outputable b, Outputable c) => Outputable (a, b, c) Source # 
Instance details

Defined in Outputable

Methods

ppr :: (a, b, c) -> SDoc Source #

pprPrec :: Rational -> (a, b, c) -> SDoc Source #

(OutputableBndrId pl, OutputableBndrId pr, Outputable body) => Outputable (StmtLR (GhcPass pl) (GhcPass pr) body) Source # 
Instance details

Defined in GHC.Hs.Expr

Methods

ppr :: StmtLR (GhcPass pl) (GhcPass pr) body -> SDoc Source #

pprPrec :: Rational -> StmtLR (GhcPass pl) (GhcPass pr) body -> SDoc Source #

(Outputable a, Outputable b, Outputable c, Outputable d) => Outputable (a, b, c, d) Source # 
Instance details

Defined in Outputable

Methods

ppr :: (a, b, c, d) -> SDoc Source #

pprPrec :: Rational -> (a, b, c, d) -> SDoc Source #

(Outputable a, Outputable b, Outputable c, Outputable d, Outputable e) => Outputable (a, b, c, d, e) Source # 
Instance details

Defined in Outputable

Methods

ppr :: (a, b, c, d, e) -> SDoc Source #

pprPrec :: Rational -> (a, b, c, d, e) -> SDoc Source #

(Outputable a, Outputable b, Outputable c, Outputable d, Outputable e, Outputable f) => Outputable (a, b, c, d, e, f) Source # 
Instance details

Defined in Outputable

Methods

ppr :: (a, b, c, d, e, f) -> SDoc Source #

pprPrec :: Rational -> (a, b, c, d, e, f) -> SDoc Source #

(Outputable a, Outputable b, Outputable c, Outputable d, Outputable e, Outputable f, Outputable g) => Outputable (a, b, c, d, e, f, g) Source # 
Instance details

Defined in Outputable

Methods

ppr :: (a, b, c, d, e, f, g) -> SDoc Source #

pprPrec :: Rational -> (a, b, c, d, e, f, g) -> SDoc Source #

class Outputable a => OutputableBndr a where Source #

When we print a binder, we often want to print its type too. The OutputableBndr class encapsulates this idea.

Minimal complete definition

pprPrefixOcc, pprInfixOcc

Instances
OutputableBndr Name Source # 
Instance details

Defined in Name

OutputableBndr OccName Source # 
Instance details

Defined in OccName

OutputableBndr Var Source # 
Instance details

Defined in PprCore

OutputableBndr RdrName Source # 
Instance details

Defined in RdrName

OutputableBndr PatSyn Source # 
Instance details

Defined in PatSyn

OutputableBndr DataCon Source # 
Instance details

Defined in DataCon

OutputableBndr ConLike Source # 
Instance details

Defined in ConLike

OutputableBndr HsIPName Source # 
Instance details

Defined in GHC.Hs.Types

OutputableBndr name => OutputableBndr (IEWrappedName name) Source # 
Instance details

Defined in GHC.Hs.ImpExp

Outputable b => OutputableBndr (TaggedBndr b) Source # 
Instance details

Defined in PprCore

OutputableBndr (AmbiguousFieldOcc (GhcPass p)) Source # 
Instance details

Defined in GHC.Hs.Types

Pretty printing combinators

data SDoc Source #

Represents a pretty-printable document.

To display an SDoc, use printSDoc, printSDocLn, bufLeftRenderSDoc, or renderWithStyle. Avoid calling runSDoc directly as it breaks the abstraction layer.

Instances
IsString SDoc Source # 
Instance details

Defined in Outputable

Methods

fromString :: String -> SDoc #

Outputable SDoc Source # 
Instance details

Defined in Outputable

runSDoc :: SDoc -> SDocContext -> Doc Source #

interppSP :: Outputable a => [a] -> SDoc Source #

Returns the separated concatenation of the pretty printed things.

interpp'SP :: Outputable a => [a] -> SDoc Source #

Returns the comma-separated concatenation of the pretty printed things.

pprQuotedList :: Outputable a => [a] -> SDoc Source #

Returns the comma-separated concatenation of the quoted pretty printed things.

[x,y,z]  ==>  `x', `y', `z'

pprWithCommas Source #

Arguments

:: (a -> SDoc)

The pretty printing function to use

-> [a]

The things to be pretty printed

-> SDoc

SDoc where the things have been pretty printed, comma-separated and finally packed into a paragraph.

pprWithBars Source #

Arguments

:: (a -> SDoc)

The pretty printing function to use

-> [a]

The things to be pretty printed

-> SDoc

SDoc where the things have been pretty printed, bar-separated and finally packed into a paragraph.

nest :: Int -> SDoc -> SDoc Source #

Indent SDoc some specified amount

doublePrec :: Int -> Double -> SDoc Source #

doublePrec p n shows a floating point number n with p digits of precision after the decimal point.

(<>) :: SDoc -> SDoc -> SDoc Source #

Join two SDoc together horizontally without a gap

(<+>) :: SDoc -> SDoc -> SDoc Source #

Join two SDoc together horizontally with a gap between them

hcat :: [SDoc] -> SDoc Source #

Concatenate SDoc horizontally

hsep :: [SDoc] -> SDoc Source #

Concatenate SDoc horizontally with a space between each one

($$) :: SDoc -> SDoc -> SDoc Source #

Join two SDoc together vertically; if there is no vertical overlap it "dovetails" the two onto one line

($+$) :: SDoc -> SDoc -> SDoc Source #

Join two SDoc together vertically

vcat :: [SDoc] -> SDoc Source #

Concatenate SDoc vertically with dovetailing

sep :: [SDoc] -> SDoc Source #

Separate: is either like hsep or like vcat, depending on what fits

cat :: [SDoc] -> SDoc Source #

Catenate: is either like hcat or like vcat, depending on what fits

fsep :: [SDoc] -> SDoc Source #

A paragraph-fill combinator. It's much like sep, only it keeps fitting things on one line until it can't fit any more.

fcat :: [SDoc] -> SDoc Source #

This behaves like fsep, but it uses <> for horizontal conposition rather than <+>

hang Source #

Arguments

:: SDoc

The header

-> Int

Amount to indent the hung body

-> SDoc

The hung body, indented and placed below the header

-> SDoc 

hangNotEmpty :: SDoc -> Int -> SDoc -> SDoc Source #

This behaves like hang, but does not indent the second document when the header is empty.

punctuate Source #

Arguments

:: SDoc

The punctuation

-> [SDoc]

The list that will have punctuation added between every adjacent pair of elements

-> [SDoc]

Punctuated list

speakNth :: Int -> SDoc Source #

Converts an integer to a verbal index:

speakNth 1 = text "first"
speakNth 5 = text "fifth"
speakNth 21 = text "21st"

speakN :: Int -> SDoc Source #

Converts an integer to a verbal multiplicity:

speakN 0 = text "none"
speakN 5 = text "five"
speakN 10 = text "10"

speakNOf :: Int -> SDoc -> SDoc Source #

Converts an integer and object description to a statement about the multiplicity of those objects:

speakNOf 0 (text "melon") = text "no melons"
speakNOf 1 (text "melon") = text "one melon"
speakNOf 3 (text "melon") = text "three melons"

plural :: [a] -> SDoc Source #

Determines the pluralisation suffix appropriate for the length of a list:

plural [] = char 's'
plural ["Hello"] = empty
plural ["Hello", "World"] = char 's'

isOrAre :: [a] -> SDoc Source #

Determines the form of to be appropriate for the length of a list:

isOrAre [] = text "are"
isOrAre ["Hello"] = text "is"
isOrAre ["Hello", "World"] = text "are"

doOrDoes :: [a] -> SDoc Source #

Determines the form of to do appropriate for the length of a list:

doOrDoes [] = text "do"
doOrDoes ["Hello"] = text "does"
doOrDoes ["Hello", "World"] = text "do"

coloured :: PprColour -> SDoc -> SDoc Source #

Apply the given colour/style for the argument.

Only takes effect if colours are enabled.

Converting SDoc into strings and outputing it

printSDoc :: Mode -> DynFlags -> Handle -> PprStyle -> SDoc -> IO () Source #

The analog of printDoc_ for SDoc, which tries to make sure the terminal doesn't get screwed up by the ANSI color codes if an exception is thrown during pretty-printing.

printSDocLn :: Mode -> DynFlags -> Handle -> PprStyle -> SDoc -> IO () Source #

Like printSDoc but appends an extra newline.

printForC :: DynFlags -> Handle -> SDoc -> IO () Source #

Like printSDocLn but specialized with LeftMode and PprCode CStyle. This is typically used to output C-- code.

bufLeftRenderSDoc :: DynFlags -> BufHandle -> PprStyle -> SDoc -> IO () Source #

An efficient variant of printSDoc specialized for LeftMode that outputs to a BufHandle.

pprHsChar :: Char -> SDoc Source #

Special combinator for showing character literals.

pprHsString :: FastString -> SDoc Source #

Special combinator for showing string literals.

pprHsBytes :: ByteString -> SDoc Source #

Special combinator for showing bytestring literals.

pprPrimChar :: Char -> SDoc Source #

Special combinator for showing unboxed literals.

pprFilePathString :: FilePath -> SDoc Source #

Normalise, escape and render a string representing a path

e.g. "c:\whatever"

Controlling the style in which output is printed

data BindingSite Source #

BindingSite is used to tell the thing that prints binder what language construct is binding the identifier. This can be used to decide how much info to print. Also see Note [Binding-site specific printing] in PprCore

Constructors

LambdaBind

The x in (x. e)

CaseBind

The x in case scrut of x { (y,z) -> ... }

CasePatBind

The y,z in case scrut of x { (y,z) -> ... }

LetBind

The x in (let x = rhs in e)

data PprStyle Source #

Instances
Outputable PprStyle Source # 
Instance details

Defined in Outputable

data CodeStyle Source #

Constructors

CStyle 
AsmStyle 

data PrintUnqualified Source #

When printing code that contains original names, we need to map the original names back to something the user understands. This is the purpose of the triple of functions that gets passed around when rendering SDoc.

type QueryQualifyName = Module -> OccName -> QualifyName Source #

Given a Name's Module and OccName, decide whether and how to qualify it.

type QueryQualifyModule = Module -> Bool Source #

For a given module, we need to know whether to print it with a package name to disambiguate it.

type QueryQualifyPackage = UnitId -> Bool Source #

For a given package, we need to know whether to print it with the component id to disambiguate it.

alwaysQualifyNames :: QueryQualifyName Source #

NB: This won't ever show package IDs

withPprStyleDoc :: DynFlags -> PprStyle -> SDoc -> Doc Source #

This is not a recommended way to render SDoc, since it breaks the abstraction layer of SDoc. Prefer to use printSDoc, printSDocLn, bufLeftRenderSDoc, or renderWithStyle instead.

pprDeeperList :: ([SDoc] -> SDoc) -> [SDoc] -> SDoc Source #

Truncate a list that is longer than the current depth.

mkErrStyle :: DynFlags -> PrintUnqualified -> PprStyle Source #

Style for printing error messages

data Depth Source #

Constructors

AllTheWay 
PartWay Int 

ifPprDebug :: SDoc -> SDoc -> SDoc Source #

Says what to do with and without -dppr-debug

whenPprDebug :: SDoc -> SDoc Source #

Says what to do with -dppr-debug; without, return empty

Error handling and debugging utilities

pprPanic :: HasCallStack => String -> SDoc -> a Source #

Throw an exception saying "bug in GHC"

pprSorry :: String -> SDoc -> a Source #

Throw an exception saying "this isn't finished yet"

assertPprPanic :: HasCallStack => String -> Int -> SDoc -> a Source #

Panic with an assertation failure, recording the given file and line number. Should typically be accessed with the ASSERT family of macros

pprPgmError :: String -> SDoc -> a Source #

Throw an exception saying "bug in pgm being compiled" (used for unusual program errors)

pprTrace :: String -> SDoc -> a -> a Source #

If debug output is on, show some SDoc on the screen

pprTraceDebug :: String -> SDoc -> a -> a Source #

pprTraceWith :: String -> (a -> SDoc) -> a -> a Source #

pprTraceWith desc f x is equivalent to pprTrace desc (f x) x. This allows you to print details from the returned value as well as from ambient variables.

pprTraceIt :: Outputable a => String -> a -> a Source #

pprTraceIt desc x is equivalent to pprTrace desc (ppr x) x

warnPprTrace :: HasCallStack => Bool -> String -> Int -> SDoc -> a -> a Source #

Just warn about an assertion failure, recording the given file and line number. Should typically be accessed with the WARN macros

pprSTrace :: HasCallStack => SDoc -> a -> a Source #

If debug output is on, show some SDoc on the screen along with a call stack when available.

pprTraceException :: ExceptionMonad m => String -> SDoc -> m a -> m a Source #

pprTraceException desc x action runs action, printing a message if it throws an exception.

trace :: String -> a -> a #

The trace function outputs the trace message given as its first argument, before returning the second argument as its result.

For example, this returns the value of f x but first outputs the message.

>>> let x = 123; f = show
>>> trace ("calling f with x = " ++ show x) (f x)
"calling f with x = 123
123"

The trace function should only be used for debugging, or for monitoring execution. The function is not referentially transparent: its type indicates that it is a pure function but it has the side effect of outputting the trace message.

pgmError :: String -> a Source #

Panics and asserts.

panic :: String -> a Source #

Panics and asserts.

sorry :: String -> a Source #

Panics and asserts.

assertPanic :: String -> Int -> a Source #

Throw a failed assertion exception for a given filename and line number.

pprDebugAndThen :: DynFlags -> (String -> a) -> SDoc -> SDoc -> a Source #