summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core/Ppr.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/GHC/Core/Ppr.hs')
-rw-r--r--compiler/GHC/Core/Ppr.hs15
1 files changed, 14 insertions, 1 deletions
diff --git a/compiler/GHC/Core/Ppr.hs b/compiler/GHC/Core/Ppr.hs
index 43579082a9..b319abec08 100644
--- a/compiler/GHC/Core/Ppr.hs
+++ b/compiler/GHC/Core/Ppr.hs
@@ -23,13 +23,15 @@ module GHC.Core.Ppr (
pprCoreBinding, pprCoreBindings, pprCoreAlt,
pprCoreBindingWithSize, pprCoreBindingsWithSize,
pprCoreBinder, pprCoreBinders,
- pprRule, pprRules, pprOptCo
+ pprRule, pprRules, pprOptCo,
+ pprOcc, pprOccWithTick
) where
import GHC.Prelude
import GHC.Core
import GHC.Core.Stats (exprStats)
+import GHC.Types.Fixity (LexicalFixity(..))
import GHC.Types.Literal( pprLiteral )
import GHC.Types.Name( pprInfixName, pprPrefixName )
import GHC.Types.Var
@@ -382,6 +384,17 @@ instance Outputable b => OutputableBndr (TaggedBndr b) where
pprPrefixOcc b = ppr b
bndrIsJoin_maybe (TB b _) = isJoinId_maybe b
+pprOcc :: OutputableBndr a => LexicalFixity -> a -> SDoc
+pprOcc Infix = pprInfixOcc
+pprOcc Prefix = pprPrefixOcc
+
+pprOccWithTick :: OutputableBndr a => LexicalFixity -> PromotionFlag -> a -> SDoc
+pprOccWithTick fixity prom op
+ | isPromoted prom
+ = quote (pprOcc fixity op)
+ | otherwise
+ = pprOcc fixity op
+
pprCoreBinder :: BindingSite -> Var -> SDoc
pprCoreBinder LetBind binder
| isTyVar binder = pprKindedTyVarBndr binder