ghc-8.4.0.20180118: 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 # 
Instance details
Outputable Char # 
Instance details
Outputable Int # 
Instance details

Methods

ppr :: Int -> SDoc Source #

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

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

Methods

ppr :: () -> SDoc Source #

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

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

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

Methods

ppr :: Var -> SDoc Source #

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

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

Methods

ppr :: Loc -> SDoc Source #

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

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

Methods

ppr :: Ct -> SDoc Source #

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

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

Methods

ppr :: [a] -> SDoc Source #

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

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

Methods

ppr :: Maybe a -> SDoc Source #

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

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

Methods

ppr :: IntMap elt -> SDoc Source #

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

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

Methods

ppr :: SCC a -> SDoc Source #

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

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

Methods

ppr :: Set a -> SDoc Source #

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

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

Methods

ppr :: Pair a -> SDoc Source #

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

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

Methods

ppr :: UniqFM a -> SDoc Source #

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

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

Methods

ppr :: Graph node -> SDoc Source #

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

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

Methods

ppr :: Bag a -> SDoc Source #

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

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

Methods

ppr :: OccEnv a -> SDoc Source #

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

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

Methods

ppr :: AnnTarget name -> SDoc Source #

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

Outputable (CoAxiom br) # 
Instance details

Methods

ppr :: CoAxiom br -> SDoc Source #

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

Outputable a => Outputable (UnifyResultM a) # 
Instance details
Outputable b => Outputable (TaggedBndr b) # 
Instance details
Outputable a => Outputable (CoreMap a) # 
Instance details
Outputable bdee => Outputable (GenStgArg bdee) # 
Instance details

Methods

ppr :: GenStgArg bdee -> SDoc Source #

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

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

Methods

ppr :: ListGraph instr -> SDoc Source #

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

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

Methods

ppr :: LiveInstr instr -> SDoc Source #

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

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

Methods

ppr :: InstrSR instr -> SDoc Source #

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

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

Methods

ppr :: Pat pass -> SDoc Source #

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

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

Methods

ppr :: IE pass -> SDoc Source #

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

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

Methods

ppr :: ImportDecl pass -> SDoc Source #

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

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

Methods

ppr :: HsCmd p -> SDoc Source #

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

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

Methods

ppr :: HsExpr p -> SDoc Source #

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

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

Methods

ppr :: FieldOcc pass -> SDoc Source #

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

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

Methods

ppr :: HsAppType pass -> SDoc Source #

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

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

Methods

ppr :: HsType pass -> SDoc Source #

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

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

Methods

ppr :: LHsQTyVars pass -> SDoc Source #

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

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

Methods

ppr :: HsLit x -> SDoc Source #

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

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

Methods

ppr :: FixitySig pass -> SDoc Source #

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

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

Methods

ppr :: Sig pass -> SDoc Source #

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

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

Methods

ppr :: IPBind p -> SDoc Source #

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

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

Methods

ppr :: AnnDecl pass -> SDoc Source #

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

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

Methods

ppr :: WarnDecl pass -> SDoc Source #

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

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

Methods

ppr :: WarnDecls pass -> SDoc Source #

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

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

Methods

ppr :: VectDecl pass -> SDoc Source #

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

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

Methods

ppr :: RuleBndr pass -> SDoc Source #

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

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

Methods

ppr :: RuleDecl pass -> SDoc Source #

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

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

Methods

ppr :: RuleDecls pass -> SDoc Source #

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

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

Methods

ppr :: DerivDecl pass -> SDoc Source #

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

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

Methods

ppr :: InstDecl pass -> SDoc Source #

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

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

Methods

ppr :: ConDecl pass -> SDoc Source #

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

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

Methods

ppr :: HsDataDefn pass -> SDoc Source #

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

Outputable (FamilyInfo pass) # 
Instance details

Methods

ppr :: FamilyInfo pass -> SDoc Source #

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

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

Methods

ppr :: FamilyDecl pass -> SDoc Source #

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

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

Methods

ppr :: TyClGroup pass -> SDoc Source #

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

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

Methods

ppr :: TyClDecl pass -> SDoc Source #

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

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

Methods

ppr :: SpliceDecl pass -> SDoc Source #

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

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

Methods

ppr :: HsGroup pass -> SDoc Source #

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

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

Methods

ppr :: HsDecl pass -> SDoc Source #

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

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

Methods

ppr :: HsModule pass -> SDoc Source #

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

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

Methods

ppr :: DerivSpec theta -> SDoc Source #

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

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

Methods

ppr :: Either a b -> SDoc Source #

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

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

Methods

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

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

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

Methods

ppr :: Map key elt -> SDoc Source #

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

(Outputable l, Outputable e) => Outputable (GenLocated l e) # 
Instance details
(Outputable k, Outputable a) => Outputable (UniqMap k a) # 
Instance details

Methods

ppr :: UniqMap k a -> SDoc Source #

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

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

Methods

ppr :: Node a b -> SDoc Source #

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

Outputable tv => Outputable (TyVarBndr tv ArgFlag) # 
Instance details
Outputable tv => Outputable (TyVarBndr tv TyConBndrVis) # 
Instance details
(TrieMap m, Outputable a) => Outputable (ListMap m a) # 
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) # 
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) # 
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) # 
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) # 
Instance details

Methods

ppr :: GenStgTopBinding bndr bdee -> SDoc Source #

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

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

Methods

ppr :: HsConDetails arg rec -> SDoc Source #

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

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

Methods

ppr :: HsWildCardBndrs pass thing -> SDoc Source #

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

Outputable thing => Outputable (HsImplicitBndrs pass thing) # 
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) # 
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) # 
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) # 
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) # 
Instance details

Methods

ppr :: HsLocalBindsLR idL idR -> SDoc Source #

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

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

Methods

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

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

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

Methods

ppr :: HsRecFields p arg -> SDoc Source #

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

(SourceTextX idL, OutputableBndrId idL) => Outputable (ParStmtBlock idL idR) # 
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) # 
Instance details

Methods

ppr :: Match idR body -> SDoc Source #

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

(Outputable statics, Outputable instr) => Outputable (RegAllocStats statics instr) # 
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) # 
Instance details

Methods

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

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

(SourceTextX idL, SourceTextX idR, OutputableBndrId idL, OutputableBndrId idR, Outputable body) => Outputable (StmtLR idL idR body) # 
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) # 
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) # 
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) # 
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) # 
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 # 
Instance details
OutputableBndr OccName # 
Instance details
OutputableBndr RdrName # 
Instance details
OutputableBndr PatSyn # 
Instance details
OutputableBndr DataCon # 
Instance details
OutputableBndr ConLike # 
Instance details
OutputableBndr HsIPName # 
Instance details
OutputableBndr name => OutputableBndr (IEWrappedName name) # 
Instance details
OutputableBndr (AmbiguousFieldOcc pass) # 
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 # 
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 # 
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 #