ghc-8.4.1: The GHC API

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

Methods

ppr :: a -> SDoc Source #

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

Instances
Outputable Bool Source # 
Instance details
Outputable Char Source # 
Instance details
Outputable Int Source # 
Instance details

Methods

ppr :: Int -> SDoc Source #

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

Outputable Int32 Source # 
Instance details
Outputable Int64 Source # 
Instance details
Outputable Integer Source # 
Instance details
Outputable Ordering Source # 
Instance details
Outputable Word Source # 
Instance details
Outputable Word16 Source # 
Instance details
Outputable Word32 Source # 
Instance details
Outputable () Source # 
Instance details

Methods

ppr :: () -> SDoc Source #

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

Outputable Fingerprint Source # 
Instance details
Outputable Extension Source # 
Instance details
Outputable Serialized Source # 
Instance details
Outputable Name Source # 
Instance details
Outputable OccName Source # 
Instance details
Outputable PrimOp Source # 
Instance details
Outputable TyCon Source # 
Instance details
Outputable FastString Source # 
Instance details
Outputable ComponentId Source # 
Instance details
Outputable InstalledUnitId Source # 
Instance details
Outputable UnitId Source # 
Instance details
Outputable ModuleName Source # 
Instance details
Outputable Module Source # 
Instance details
Outputable QualifyName Source # 
Instance details
Outputable PprStyle Source # 
Instance details
Outputable TyBinder Source # 
Instance details
Outputable TCvSubst Source # 
Instance details
Outputable UnivCoProvenance Source # 
Instance details
Outputable Coercion Source # 
Instance details
Outputable TyThing Source # 
Instance details
Outputable Type Source # 
Instance details
Outputable MetaDetails Source # 
Instance details
Outputable SrcSpan Source # 
Instance details
Outputable RealSrcSpan Source # 
Instance details
Outputable SrcLoc Source # 
Instance details
Outputable RealSrcLoc Source # 
Instance details
Outputable IdDetails Source # 
Instance details
Outputable HsDocString Source # 
Instance details
Outputable IntWithInf Source # 
Instance details
Outputable FractionalLit Source # 
Instance details
Outputable IntegralLit Source # 
Instance details
Outputable InlineSpec Source # 
Instance details
Outputable InlinePragma Source # 
Instance details
Outputable RuleMatchInfo Source # 
Instance details
Outputable Activation Source # 
Instance details
Outputable CompilerPhase Source # 
Instance details
Outputable SourceText Source # 
Instance details
Outputable SuccessFlag Source # 
Instance details
Outputable TailCallInfo Source # 
Instance details
Outputable OccInfo Source # 
Instance details
Outputable OverlapMode Source # 
Instance details
Outputable OverlapFlag Source # 
Instance details
Outputable DerivStrategy Source # 
Instance details
Outputable Origin Source # 
Instance details
Outputable RecFlag Source # 
Instance details
Outputable Boxity Source # 
Instance details
Outputable TopLevelFlag Source # 
Instance details
Outputable LexicalFixity Source # 
Instance details
Outputable FixityDirection Source # 
Instance details
Outputable Fixity Source # 
Instance details
Outputable WarningTxt Source # 
Instance details
Outputable StringLiteral Source # 
Instance details
Outputable FunctionOrData Source # 
Instance details
Outputable SwapFlag Source # 
Instance details
Outputable OneShotInfo Source # 
Instance details
Outputable LeftOrRight Source # 
Instance details
Outputable Unique Source # 
Instance details
Outputable RegClass Source # 
Instance details
Outputable Reg Source #

Print a reg in a generic manner If you want the architecture specific names, then use the pprReg function from the appropriate Ppr module.

Instance details

Methods

ppr :: Reg -> SDoc Source #

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

Outputable RealReg Source # 
Instance details
Outputable VirtualReg Source # 
Instance details
Outputable LabelSet Source # 
Instance details
Outputable Label Source # 
Instance details
Outputable DefUnitId Source # 
Instance details
Outputable InstalledModule Source # 
Instance details
Outputable IndefModule Source # 
Instance details
Outputable IndefUnitId Source # 
Instance details
Outputable ModLocation Source # 
Instance details
Outputable PackageName Source # 
Instance details
Outputable SourcePackageId Source # 
Instance details
Outputable CType Source # 
Instance details
Outputable Header Source # 
Instance details
Outputable CCallConv Source # 
Instance details
Outputable CCallSpec Source # 
Instance details
Outputable CExportSpec Source # 
Instance details
Outputable Safety Source # 
Instance details
Outputable ForeignCall Source # 
Instance details
Outputable Phase Source # 
Instance details
Outputable WarnReason Source # 
Instance details
Outputable PackageFlag Source # 
Instance details
Outputable ModRenaming Source # 
Instance details
Outputable PackageArg Source # 
Instance details
Outputable GhcMode Source # 
Instance details
Outputable SafeHaskellMode Source # 
Instance details
Outputable Language Source # 
Instance details
Outputable WarnReason Source # 
Instance details
Outputable ArgDescr Source # 
Instance details
Outputable ClosureTypeInfo Source # 
Instance details
Outputable SMRep Source # 
Instance details
Outputable StgHalfWord Source # 
Instance details
Outputable StgWord Source # 
Instance details
Outputable Annotation Source # 
Instance details
Outputable ModuleOrigin Source # 
Instance details
Outputable ForeignHint Source # 
Instance details
Outputable Width Source # 
Instance details
Outputable CmmType Source # 
Instance details
Outputable AvailInfo Source # 
Instance details
Outputable ImportSpec Source # 
Instance details
Outputable Parent Source # 
Instance details
Outputable GlobalRdrElt Source # 
Instance details
Outputable LocalRdrEnv Source # 
Instance details
Outputable RdrName Source # 
Instance details
Outputable AnnotationComment Source # 
Instance details
Outputable AnnKeywordId Source # 
Instance details
Outputable Token Source # 
Instance details
Outputable ArgFlag Source # 
Instance details
Outputable Var Source # 
Instance details

Methods

ppr :: Var -> SDoc Source #

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

Outputable PatSyn Source # 
Instance details
Outputable IfaceCoercion Source # 
Instance details
Outputable IfaceTyLit Source # 
Instance details
Outputable IfaceTyCon Source # 
Instance details
Outputable IfaceType Source # 
Instance details
Outputable IfaceTcArgs Source # 
Instance details
Outputable EqSpec Source # 
Instance details
Outputable DataCon Source # 
Instance details
Outputable ConLike Source # 
Instance details
Outputable CostCentreStack Source # 
Instance details
Outputable CostCentre Source # 
Instance details
Outputable CoAxiomRule Source # 
Instance details
Outputable Role Source # 
Instance details
Outputable CoAxBranch Source # 
Instance details
Outputable LiftingContext Source # 
Instance details
Outputable Class Source # 
Instance details
Outputable TyConFlavour Source # 
Instance details
Outputable PrimElemRep Source # 
Instance details
Outputable PrimRep Source # 
Instance details
Outputable FamTyConFlav Source # 
Instance details
Outputable AlgTyConFlav Source # 
Instance details
Outputable IfaceBndr Source # 
Instance details
Outputable InScopeSet Source # 
Instance details
Outputable CoercionHole Source # 
Instance details
Outputable EqRel Source # 
Instance details
Outputable Literal Source # 
Instance details
Outputable StrictnessMark Source # 
Instance details
Outputable SrcUnpackedness Source # 
Instance details
Outputable SrcStrictness Source # 
Instance details
Outputable HsImplBang Source # 
Instance details
Outputable HsSrcBang Source # 
Instance details
Outputable SlotTy Source # 
Instance details
Outputable StrictSig Source # 
Instance details
Outputable DmdType Source # 
Instance details
Outputable CPRResult Source # 
Instance details
Outputable TypeShape Source # 
Instance details
Outputable Count Source # 
Instance details
Outputable UseDmd Source # 
Instance details
Outputable StrDmd Source # 
Instance details
Outputable UnfoldingGuidance Source # 
Instance details
Outputable UnfoldingSource Source # 
Instance details
Outputable Unfolding Source # 
Instance details
Outputable CoreVect Source # 
Instance details
Outputable CoreRule Source # 
Instance details
Outputable AltCon Source # 
Instance details
Outputable FamInstMatch Source # 
Instance details
Outputable FamInst Source # 
Instance details
Outputable LevityInfo Source # 
Instance details
Outputable TickBoxOp Source # 
Instance details
Outputable CafInfo Source # 
Instance details
Outputable RecSelParent Source # 
Instance details
Outputable UnVarGraph Source # 
Instance details
Outputable UnVarSet Source # 
Instance details
Outputable PrimCall Source # 
Instance details
Outputable CgBreakInfo Source # 
Instance details
Outputable UnlinkedBCO Source # 
Instance details
Outputable CompiledByteCode Source # 
Instance details
Outputable CoreStats Source # 
Instance details
Outputable UpdateFlag Source # 
Instance details
Outputable AltType Source # 
Instance details
Outputable ShowHowMuch Source # 
Instance details
Outputable IfaceJoinInfo Source # 
Instance details
Outputable IfaceConAlt Source # 
Instance details
Outputable IfaceExpr Source # 
Instance details
Outputable IfaceIdDetails Source # 
Instance details
Outputable IfaceUnfolding Source # 
Instance details
Outputable IfaceInfoItem Source # 
Instance details
Outputable IfaceIdInfo Source # 
Instance details
Outputable IfaceCompleteMatch Source # 
Instance details
Outputable IfaceAnnotation Source # 
Instance details
Outputable IfaceRule Source # 
Instance details
Outputable IfaceFamInst Source # 
Instance details
Outputable IfaceClsInst Source # 
Instance details
Outputable IfaceAT Source # 
Instance details
Outputable IfaceClassOp Source # 
Instance details
Outputable IfaceTyConParent Source # 
Instance details
Outputable IfaceDecl Source # 
Instance details
Outputable ForeignLabelSource Source # 
Instance details
Outputable CLabel Source # 
Instance details
Outputable GlobalReg Source # 
Instance details
Outputable LocalReg Source # 
Instance details
Outputable CmmLit Source # 
Instance details
Outputable Area Source # 
Instance details
Outputable CmmReg Source # 
Instance details
Outputable CmmExpr Source # 
Instance details
Outputable CmmTickScope Source # 
Instance details
Outputable ForeignTarget Source # 
Instance details
Outputable CmmReturnInfo Source # 
Instance details
Outputable ForeignConvention Source # 
Instance details
Outputable Convention Source # 
Instance details
Outputable CmmStatics Source # 
Instance details
Outputable CmmStatic Source # 
Instance details
Outputable C_SRT Source # 
Instance details
Outputable CmmInfoTable Source # 
Instance details
Outputable CmmStackInfo Source # 
Instance details
Outputable CmmTopInfo Source # 
Instance details
Outputable CmmGraph Source # 
Instance details
Outputable LlvmCastOp Source # 
Instance details
Outputable LlvmCmpOp Source # 
Instance details
Outputable LlvmMachOp Source # 
Instance details
Outputable LlvmLinkageType Source # 
Instance details
Outputable LlvmCallConvention Source # 
Instance details
Outputable LlvmFuncAttr Source # 
Instance details
Outputable LlvmParamAttr Source # 
Instance details
Outputable LlvmFunctionDecl Source # 
Instance details
Outputable LlvmStatic Source # 
Instance details
Outputable LlvmLit Source # 
Instance details
Outputable LlvmVar Source # 
Instance details
Outputable LlvmType Source # 
Instance details
Outputable MetaExpr Source # 
Instance details
Outputable MetaId Source # 
Instance details
Outputable LiveInfo Source # 
Instance details
Outputable Loc Source # 
Instance details

Methods

ppr :: Loc -> SDoc Source #

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

Outputable SpillStats Source # 
Instance details
Outputable UnwindExpr Source # 
Instance details
Outputable UnwindPoint Source # 
Instance details
Outputable DebugBlock Source # 
Instance details
Outputable Status Source # 
Instance details
Outputable ParamLocation Source # 
Instance details
Outputable TopSRT Source # 
Instance details
Outputable CandidatesQTvs Source # 
Instance details
Outputable TcLevel Source # 
Instance details
Outputable InferResult Source # 
Instance details
Outputable ExpType Source # 
Instance details
Outputable EvCallStack Source # 
Instance details
Outputable EvLit Source # 
Instance details
Outputable EvTypeable Source # 
Instance details
Outputable EvTerm Source # 
Instance details
Outputable EvBind Source # 
Instance details
Outputable EvBindMap Source # 
Instance details
Outputable EvBindsVar Source # 
Instance details
Outputable TcEvBinds Source # 
Instance details
Outputable HsWrapper Source # 
Instance details
Outputable HsTyLit Source # 
Instance details
Outputable HsIPName Source # 
Instance details
Outputable OverLitVal Source # 
Instance details
Outputable TcSpecPrag Source # 
Instance details
Outputable CgLoc Source # 
Instance details
Outputable Sequel Source # 
Instance details
Outputable CgIdInfo Source # 
Instance details
Outputable ArgRep Source # 
Instance details
Outputable ClsInst Source # 
Instance details
Outputable DocDecl Source # 
Instance details
Outputable ForeignExport Source # 
Instance details
Outputable ForeignImport Source # 
Instance details
Outputable NewOrData Source # 
Instance details
Outputable PendingTcSplice Source # 
Instance details
Outputable PendingRnSplice Source # 
Instance details
Outputable SpliceDecoration Source # 
Instance details
Outputable UnboundVar Source # 
Instance details
Outputable PmLit Source # 
Instance details
Outputable PmExpr Source # 
Instance details
Outputable CompleteMatch Source # 
Instance details
Outputable Unlinked Source # 
Instance details
Outputable Linkable Source # 
Instance details
Outputable IfaceTrustInfo Source # 
Instance details
Outputable IfaceVectInfo Source # 
Instance details
Outputable VectInfo Source # 
Instance details
Outputable ModSummary Source # 
Instance details
Outputable FixItem Source # 
Instance details
Outputable Warnings Source # 
Instance details
Outputable InteractiveImport Source # 
Instance details
Outputable SptEntry Source # 
Instance details
Outputable TargetId Source # 
Instance details
Outputable Target Source # 
Instance details
Outputable TypeOrKind Source # 
Instance details
Outputable CtOrigin Source # 
Instance details
Outputable SkolemInfo Source # 
Instance details
Outputable SubGoalDepth Source # 
Instance details
Outputable CtFlavour Source # 
Instance details
Outputable CtEvidence Source # 
Instance details
Outputable TcEvDest Source # 
Instance details
Outputable ImplicStatus Source # 
Instance details
Outputable Implication Source # 
Instance details
Outputable WantedConstraints Source # 
Instance details
Outputable Hole Source # 
Instance details
Outputable Ct Source # 
Instance details

Methods

ppr :: Ct -> SDoc Source #

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

Outputable TcPatSynInfo Source # 
Instance details
Outputable TcIdSigInst Source # 
Instance details
Outputable TcIdSigInfo Source # 
Instance details
Outputable TcSigInfo Source # 
Instance details
Outputable WhereFrom Source # 
Instance details
Outputable IdBindingInfo Source # 
Instance details
Outputable PromotionErr Source # 
Instance details
Outputable TcTyThing Source # 
Instance details
Outputable ThStage Source # 
Instance details
Outputable TcBinder Source # 
Instance details
Outputable PhasePlus Source # 
Instance details
Outputable HsComponentId Source # 
Instance details
Outputable FloatBind Source # 
Instance details
Outputable Subst Source # 
Instance details
Outputable CallCtxt Source # 
Instance details
Outputable ArgSummary Source # 
Instance details
Outputable Tick Source # 
Instance details
Outputable FloatOutSwitches Source # 
Instance details
Outputable SimplMode Source # 
Instance details
Outputable CoreToDo Source # 
Instance details
Outputable LetFloats Source # 
Instance details
Outputable SimplSR Source # 
Instance details
Outputable SimplFloats Source # 
Instance details
Outputable ArgSpec Source # 
Instance details
Outputable DupFlag Source # 
Instance details
Outputable SimplCont Source # 
Instance details
Outputable FloatSpec Source # 
Instance details
Outputable Level Source # 
Instance details
Outputable HsSigCtxt Source # 
Instance details
Outputable ChildLookupResult Source # 
Instance details
Outputable ClosureType Source # 
Instance details
Outputable Term Source # 
Instance details
Outputable InertCans Source # 
Instance details
Outputable InertSet Source # 
Instance details
Outputable WorkList Source # 
Instance details
Outputable FlattenMode Source # 
Instance details
Outputable InferMode Source # 
Instance details
Outputable ThetaOrigin Source # 
Instance details
Outputable PredOrigin Source # 
Instance details
Outputable DerivSpecMechanism Source # 
Instance details
Outputable DerivEnv Source # 
Instance details
Outputable BCInstr Source # 
Instance details
Outputable LetBndrSpec Source # 
Instance details
Outputable EquationInfo Source # 
Instance details
Outputable DsMatchContext Source # 
Instance details
Outputable CompRepr Source # 
Instance details
Outputable ProdRepr Source # 
Instance details
Outputable ConRepr Source # 
Instance details
Outputable SumRepr Source # 
Instance details
Outputable Instr Source # 
Instance details
Outputable Instr Source # 
Instance details
Outputable Instr Source # 
Instance details
Outputable DwarfFrameBlock Source # 
Instance details
Outputable CoreModule Source # 
Instance details
Outputable a => Outputable [a] Source # 
Instance details

Methods

ppr :: [a] -> SDoc Source #

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

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

Methods

ppr :: Maybe a -> SDoc Source #

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

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

Methods

ppr :: IntMap elt -> SDoc Source #

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

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

Methods

ppr :: SCC a -> SDoc Source #

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

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

Methods

ppr :: Set a -> SDoc Source #

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

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

Methods

ppr :: Pair a -> SDoc Source #

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

Outputable a => Outputable (OrdList a) Source # 
Instance details
Outputable (DefMethSpec ty) Source # 
Instance details
Outputable a => Outputable (UniqFM a) Source # 
Instance details

Methods

ppr :: UniqFM a -> SDoc Source #

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

Outputable a => Outputable (UniqSet a) Source # 
Instance details
Outputable a => Outputable (UniqDFM a) Source # 
Instance details
Outputable a => Outputable (LabelMap a) Source # 
Instance details
OutputableBndr a => Outputable (BooleanFormula a) Source # 
Instance details
Outputable node => Outputable (Graph node) Source # 
Instance details

Methods

ppr :: Graph node -> SDoc Source #

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

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

Methods

ppr :: Bag a -> SDoc Source #

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

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

Methods

ppr :: OccEnv a -> SDoc Source #

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

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

Methods

ppr :: AnnTarget name -> SDoc Source #

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

Outputable (CoAxiom br) Source # 
Instance details

Methods

ppr :: CoAxiom br -> SDoc Source #

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

Outputable a => Outputable (UnifyResultM a) Source # 
Instance details
Outputable b => Outputable (TaggedBndr b) Source # 
Instance details
Outputable id => Outputable (Tickish id) Source # 
Instance details

Methods

ppr :: Tickish id -> SDoc Source #

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

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

Methods

ppr :: Bind b -> SDoc Source #

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

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

Methods

ppr :: Expr b -> SDoc Source #

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

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

Methods

ppr :: GenStgArg bdee -> SDoc Source #

pprPrec :: Rational -> GenStgArg bdee -> SDoc Source #

Outputable instr => Outputable (ListGraph instr) Source # 
Instance details

Methods

ppr :: ListGraph instr -> SDoc Source #

pprPrec :: Rational -> ListGraph instr -> SDoc Source #

Outputable instr => Outputable (GenBasicBlock instr) Source # 
Instance details
Outputable instr => Outputable (LiveInstr instr) Source # 
Instance details

Methods

ppr :: LiveInstr instr -> SDoc Source #

pprPrec :: Rational -> LiveInstr instr -> SDoc Source #

Outputable instr => Outputable (InstrSR instr) Source # 
Instance details

Methods

ppr :: InstrSR instr -> SDoc Source #

pprPrec :: Rational -> InstrSR instr -> SDoc Source #

(SourceTextX pass, OutputableBndrId pass) => Outputable (Pat pass) Source # 
Instance details

Methods

ppr :: Pat pass -> SDoc Source #

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

OutputableBndrId pass => Outputable (IE pass) Source # 
Instance details

Methods

ppr :: IE pass -> SDoc Source #

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

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

Methods

ppr :: ImportDecl pass -> SDoc Source #

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

(SourceTextX p, OutputableBndrId p) => Outputable (SyntaxExpr p) Source # 
Instance details
(SourceTextX p, OutputableBndrId p) => Outputable (HsSplice p) Source # 
Instance details
(SourceTextX p, OutputableBndrId p) => Outputable (HsCmd p) Source # 
Instance details

Methods

ppr :: HsCmd p -> SDoc Source #

pprPrec :: Rational -> HsCmd p -> SDoc Source #

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

Methods

ppr :: HsExpr p -> SDoc Source #

pprPrec :: Rational -> HsExpr p -> SDoc Source #

Outputable (AmbiguousFieldOcc pass) Source # 
Instance details
Outputable (FieldOcc pass) Source # 
Instance details

Methods

ppr :: FieldOcc pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (ConDeclField pass) Source # 
Instance details
(SourceTextX pass, OutputableBndrId pass) => Outputable (HsAppType pass) Source # 
Instance details

Methods

ppr :: HsAppType pass -> SDoc Source #

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

Outputable (HsWildCardInfo pass) Source # 
Instance details
(SourceTextX pass, OutputableBndrId pass) => Outputable (HsType pass) Source # 
Instance details

Methods

ppr :: HsType pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (HsTyVarBndr pass) Source # 
Instance details
(SourceTextX pass, OutputableBndrId pass) => Outputable (LHsQTyVars pass) Source # 
Instance details

Methods

ppr :: LHsQTyVars pass -> SDoc Source #

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

(SourceTextX p, OutputableBndrId p) => Outputable (HsOverLit p) Source # 
Instance details
SourceTextX x => Outputable (HsLit x) Source # 
Instance details

Methods

ppr :: HsLit x -> SDoc Source #

pprPrec :: Rational -> HsLit x -> SDoc Source #

Outputable a => Outputable (RecordPatSynField a) Source # 
Instance details
OutputableBndrId pass => Outputable (FixitySig pass) Source # 
Instance details

Methods

ppr :: FixitySig pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (Sig pass) Source # 
Instance details

Methods

ppr :: Sig pass -> SDoc Source #

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

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

Methods

ppr :: IPBind p -> SDoc Source #

pprPrec :: Rational -> IPBind p -> SDoc Source #

(SourceTextX p, OutputableBndrId p) => Outputable (HsIPBinds p) Source # 
Instance details
OutputableBndrId p => Outputable (ABExport p) Source # 
Instance details
Outputable a => Outputable (NonVoid a) Source # 
Instance details
OutputableBndr (IdP pass) => Outputable (RoleAnnotDecl pass) Source # 
Instance details
(SourceTextX pass, OutputableBndrId pass) => Outputable (AnnDecl pass) Source # 
Instance details

Methods

ppr :: AnnDecl pass -> SDoc Source #

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

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

Methods

ppr :: WarnDecl pass -> SDoc Source #

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

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

Methods

ppr :: WarnDecls pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (VectDecl pass) Source # 
Instance details

Methods

ppr :: VectDecl pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (RuleBndr pass) Source # 
Instance details

Methods

ppr :: RuleBndr pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (RuleDecl pass) Source # 
Instance details

Methods

ppr :: RuleDecl pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (RuleDecls pass) Source # 
Instance details

Methods

ppr :: RuleDecls pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (ForeignDecl pass) Source # 
Instance details
(SourceTextX pass, OutputableBndrId pass) => Outputable (DefaultDecl pass) Source # 
Instance details
(SourceTextX pass, OutputableBndrId pass) => Outputable (DerivDecl pass) Source # 
Instance details

Methods

ppr :: DerivDecl pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (InstDecl pass) Source # 
Instance details

Methods

ppr :: InstDecl pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (ClsInstDecl pass) Source # 
Instance details
(SourceTextX pass, OutputableBndrId pass) => Outputable (DataFamInstDecl pass) Source # 
Instance details
(SourceTextX pass, OutputableBndrId pass) => Outputable (TyFamInstDecl pass) Source # 
Instance details
(SourceTextX pass, OutputableBndrId pass) => Outputable (ConDecl pass) Source # 
Instance details

Methods

ppr :: ConDecl pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (HsDerivingClause pass) Source # 
Instance details
(SourceTextX pass, OutputableBndrId pass) => Outputable (HsDataDefn pass) Source # 
Instance details

Methods

ppr :: HsDataDefn pass -> SDoc Source #

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

Outputable (FamilyInfo pass) Source # 
Instance details

Methods

ppr :: FamilyInfo pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (FamilyDecl pass) Source # 
Instance details

Methods

ppr :: FamilyDecl pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (TyClGroup pass) Source # 
Instance details

Methods

ppr :: TyClGroup pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (TyClDecl pass) Source # 
Instance details

Methods

ppr :: TyClDecl pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (SpliceDecl pass) Source # 
Instance details

Methods

ppr :: SpliceDecl pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (HsGroup pass) Source # 
Instance details

Methods

ppr :: HsGroup pass -> SDoc Source #

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

(SourceTextX pass, OutputableBndrId pass) => Outputable (HsDecl pass) Source # 
Instance details

Methods

ppr :: HsDecl pass -> SDoc Source #

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

(Outputable p, Outputable (NameOrRdrName p)) => Outputable (HsStmtContext p) Source # 
Instance details
OutputableBndr id => Outputable (HsMatchContext id) Source # 
Instance details
(SourceTextX p, OutputableBndrId p) => Outputable (ArithSeqInfo p) Source # 
Instance details
(SourceTextX p, OutputableBndrId p) => Outputable (HsBracket p) Source # 
Instance details
(SourceTextX p, OutputableBndrId p) => Outputable (HsSplicedThing p) Source # 
Instance details
(SourceTextX p, OutputableBndrId p) => Outputable (HsCmdTop p) Source # 
Instance details
(SourceTextX pass, OutputableBndrId pass) => Outputable (HsModule pass) Source # 
Instance details

Methods

ppr :: HsModule pass -> SDoc Source #

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

(SourceTextX a, OutputableBndrId a) => Outputable (InstInfo a) Source # 
Instance details
Outputable (FunDepEqn a) Source # 
Instance details
Outputable a => Outputable (StopOrContinue a) Source # 
Instance details
Outputable theta => Outputable (DerivSpec theta) Source # 
Instance details

Methods

ppr :: DerivSpec theta -> SDoc Source #

pprPrec :: Rational -> DerivSpec theta -> SDoc Source #

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

Methods

ppr :: Either a b -> SDoc Source #

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

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

Methods

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

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

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

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
(Outputable k, Outputable a) => Outputable (UniqMap k a) Source # 
Instance details

Methods

ppr :: UniqMap k a -> SDoc Source #

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

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

Methods

ppr :: Node a b -> SDoc Source #

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

Outputable tv => Outputable (TyVarBndr tv ArgFlag) Source # 
Instance details
Outputable tv => Outputable (TyVarBndr tv TyConBndrVis) Source # 
Instance details
(TrieMap m, Outputable a) => Outputable (ListMap m a) Source # 
Instance details

Methods

ppr :: ListMap m a -> SDoc Source #

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

(OutputableBndr bndr, Outputable bdee, Ord bdee) => Outputable (GenStgRhs bndr bdee) Source # 
Instance details

Methods

ppr :: GenStgRhs bndr bdee -> SDoc Source #

pprPrec :: Rational -> GenStgRhs bndr bdee -> SDoc Source #

(OutputableBndr bndr, Outputable bdee, Ord bdee) => Outputable (GenStgExpr bndr bdee) Source # 
Instance details

Methods

ppr :: GenStgExpr bndr bdee -> SDoc Source #

pprPrec :: Rational -> GenStgExpr bndr bdee -> SDoc Source #

(OutputableBndr bndr, Outputable bdee, Ord bdee) => Outputable (GenStgBinding bndr bdee) Source # 
Instance details

Methods

ppr :: GenStgBinding bndr bdee -> SDoc Source #

pprPrec :: Rational -> GenStgBinding bndr bdee -> SDoc Source #

(OutputableBndr bndr, Outputable bdee, Ord bdee) => Outputable (GenStgTopBinding bndr bdee) Source # 
Instance details

Methods

ppr :: GenStgTopBinding bndr bdee -> SDoc Source #

pprPrec :: Rational -> GenStgTopBinding bndr bdee -> SDoc Source #

Outputable (CmmNode e x) Source # 
Instance details

Methods

ppr :: CmmNode e x -> SDoc Source #

pprPrec :: Rational -> CmmNode e x -> SDoc Source #

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

Methods

ppr :: HsConDetails arg rec -> SDoc Source #

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

Outputable thing => Outputable (HsWildCardBndrs pass thing) Source # 
Instance details

Methods

ppr :: HsWildCardBndrs pass thing -> SDoc Source #

pprPrec :: Rational -> HsWildCardBndrs pass thing -> SDoc Source #

Outputable thing => Outputable (HsImplicitBndrs pass thing) Source # 
Instance details

Methods

ppr :: HsImplicitBndrs pass thing -> SDoc Source #

pprPrec :: Rational -> HsImplicitBndrs pass thing -> SDoc Source #

(SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR) => Outputable (PatSynBind idL idR) Source # 
Instance details

Methods

ppr :: PatSynBind idL idR -> SDoc Source #

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

(SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR) => Outputable (HsBindLR idL idR) Source # 
Instance details

Methods

ppr :: HsBindLR idL idR -> SDoc Source #

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

(SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR) => Outputable (HsValBindsLR idL idR) Source # 
Instance details

Methods

ppr :: HsValBindsLR idL idR -> SDoc Source #

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

(SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR) => Outputable (HsLocalBindsLR idL idR) Source # 
Instance details

Methods

ppr :: HsLocalBindsLR idL idR -> SDoc Source #

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

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

Methods

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

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

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

Methods

ppr :: HsRecFields p arg -> SDoc Source #

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

(SourceTextX idL, OutputableBndrId idL) => Outputable (ParStmtBlock idL idR) Source # 
Instance details

Methods

ppr :: ParStmtBlock idL idR -> SDoc Source #

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

(SourceTextX idR, OutputableBndrId idR, Outputable body) => Outputable (Match idR body) Source # 
Instance details

Methods

ppr :: Match idR body -> SDoc Source #

pprPrec :: Rational -> Match idR body -> SDoc Source #

(Outputable statics, Outputable instr) => Outputable (RegAllocStats statics instr) Source # 
Instance details

Methods

ppr :: RegAllocStats statics instr -> SDoc Source #

pprPrec :: Rational -> RegAllocStats statics instr -> SDoc Source #

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

Methods

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

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

Outputable (Block CmmNode C C) Source # 
Instance details
Outputable (Block CmmNode C O) Source # 
Instance details
Outputable (Block CmmNode O C) Source # 
Instance details
Outputable (Block CmmNode O O) Source # 
Instance details
Outputable (Graph CmmNode e x) Source # 
Instance details
(Outputable d, Outputable info, Outputable i) => Outputable (GenCmmDecl d info i) Source # 
Instance details

Methods

ppr :: GenCmmDecl d info i -> SDoc Source #

pprPrec :: Rational -> GenCmmDecl d info i -> SDoc Source #

(SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR, Outputable body) => Outputable (StmtLR idL idR body) Source # 
Instance details

Methods

ppr :: StmtLR idL idR body -> SDoc Source #

pprPrec :: Rational -> StmtLR idL idR body -> SDoc Source #

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

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

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

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

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
OutputableBndr OccName Source # 
Instance details
OutputableBndr RdrName Source # 
Instance details
OutputableBndr Var Source # 
Instance details
OutputableBndr PatSyn Source # 
Instance details
OutputableBndr DataCon Source # 
Instance details
OutputableBndr ConLike Source # 
Instance details
OutputableBndr HsIPName Source # 
Instance details
Outputable b => OutputableBndr (TaggedBndr b) Source # 
Instance details
OutputableBndr name => OutputableBndr (IEWrappedName name) Source # 
Instance details
OutputableBndr (AmbiguousFieldOcc pass) Source # 
Instance details

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

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.

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

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 an original name, this function tells you which module name it should be qualified with when printing for the user, if any. For example, given Control.Exception.catch, which is in scope as Exception.catch, this function will return Just Exception. Note that the return value is a ModuleName, not a Module, because in source code, names are qualified by ModuleNames.

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 #

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

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

warnPprTrace :: 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 Source #

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 #