summaryrefslogtreecommitdiff
path: root/compiler/GHC/Core
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-03-17 18:44:51 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-05-01 10:37:39 -0400
commitde9fc995c2170bc34600ee3fc80393c67cfecad1 (patch)
tree71a179e2b899cf9253ada7bddea40ab3c1e1c3e6 /compiler/GHC/Core
parentb3df9e780fb2f5658412c644849cd0f1e6f50331 (diff)
downloadhaskell-de9fc995c2170bc34600ee3fc80393c67cfecad1.tar.gz
Fully remove PprDebug
PprDebug was a pain to deal with consistently as it is implied by `-dppr-debug` but it isn't really a PprStyle. We remove it completely and query the appropriate SDoc flag instead (`sdocPprDebug`) via helpers (`getPprDebug` and its friends).
Diffstat (limited to 'compiler/GHC/Core')
-rw-r--r--compiler/GHC/Core/Ppr.hs4
-rw-r--r--compiler/GHC/Core/TyCo/Ppr.hs3
-rw-r--r--compiler/GHC/Core/TyCon.hs8
3 files changed, 9 insertions, 6 deletions
diff --git a/compiler/GHC/Core/Ppr.hs b/compiler/GHC/Core/Ppr.hs
index e9c746d7a6..c0b2749359 100644
--- a/compiler/GHC/Core/Ppr.hs
+++ b/compiler/GHC/Core/Ppr.hs
@@ -375,8 +375,8 @@ pprCoreBinder LetBind binder
-- Lambda bound type variables are preceded by "@"
pprCoreBinder bind_site bndr
- = getPprStyle $ \ sty ->
- pprTypedLamBinder bind_site (debugStyle sty) bndr
+ = getPprDebug $ \debug ->
+ pprTypedLamBinder bind_site debug bndr
pprUntypedBinder :: Var -> SDoc
pprUntypedBinder binder
diff --git a/compiler/GHC/Core/TyCo/Ppr.hs b/compiler/GHC/Core/TyCo/Ppr.hs
index 973641bf5c..6678a00559 100644
--- a/compiler/GHC/Core/TyCo/Ppr.hs
+++ b/compiler/GHC/Core/TyCo/Ppr.hs
@@ -93,7 +93,8 @@ pprPrecType = pprPrecTypeX emptyTidyEnv
pprPrecTypeX :: TidyEnv -> PprPrec -> Type -> SDoc
pprPrecTypeX env prec ty
= getPprStyle $ \sty ->
- if debugStyle sty -- Use debugPprType when in
+ getPprDebug $ \debug ->
+ if debug -- Use debugPprType when in
then debug_ppr_ty prec ty -- when in debug-style
else pprPrecIfaceType prec (tidyToIfaceTypeStyX env ty sty)
-- NB: debug-style is used for -dppr-debug
diff --git a/compiler/GHC/Core/TyCon.hs b/compiler/GHC/Core/TyCon.hs
index 863c3b2f46..0f850f2278 100644
--- a/compiler/GHC/Core/TyCon.hs
+++ b/compiler/GHC/Core/TyCon.hs
@@ -2576,9 +2576,11 @@ instance Outputable TyCon where
-- corresponding TyCon, so we add the quote to distinguish it here
ppr tc = pprPromotionQuote tc <> ppr (tyConName tc) <> pp_tc
where
- pp_tc = getPprStyle $ \sty -> if ((debugStyle sty || dumpStyle sty) && isTcTyCon tc)
- then text "[tc]"
- else empty
+ pp_tc = getPprStyle $ \sty ->
+ getPprDebug $ \debug ->
+ if ((debug || dumpStyle sty) && isTcTyCon tc)
+ then text "[tc]"
+ else empty
-- | Paints a picture of what a 'TyCon' represents, in broad strokes.
-- This is used towards more informative error messages.