summaryrefslogtreecommitdiff
path: root/compiler/basicTypes
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/basicTypes')
-rw-r--r--compiler/basicTypes/BasicTypes.hs5
-rw-r--r--compiler/basicTypes/RdrName.hs5
-rw-r--r--compiler/basicTypes/SrcLoc.hs2
3 files changed, 5 insertions, 7 deletions
diff --git a/compiler/basicTypes/BasicTypes.hs b/compiler/basicTypes/BasicTypes.hs
index 90a043de76..c6ffaad0d4 100644
--- a/compiler/basicTypes/BasicTypes.hs
+++ b/compiler/basicTypes/BasicTypes.hs
@@ -789,9 +789,8 @@ tupleParens :: TupleSort -> SDoc -> SDoc
tupleParens BoxedTuple p = parens p
tupleParens UnboxedTuple p = text "(#" <+> p <+> ptext (sLit "#)")
tupleParens ConstraintTuple p -- In debug-style write (% Eq a, Ord b %)
- = sdocWithPprDebug $ \dbg -> if dbg
- then text "(%" <+> p <+> ptext (sLit "%)")
- else parens p
+ = ifPprDebug (text "(%" <+> p <+> ptext (sLit "%)"))
+ (parens p)
{-
************************************************************************
diff --git a/compiler/basicTypes/RdrName.hs b/compiler/basicTypes/RdrName.hs
index f28ae011ac..5f496059d2 100644
--- a/compiler/basicTypes/RdrName.hs
+++ b/compiler/basicTypes/RdrName.hs
@@ -1237,9 +1237,8 @@ pprNameProvenance :: GlobalRdrElt -> SDoc
-- ^ Print out one place where the name was define/imported
-- (With -dppr-debug, print them all)
pprNameProvenance (GRE { gre_name = name, gre_lcl = lcl, gre_imp = iss })
- = sdocWithPprDebug $ \dbg -> if dbg
- then vcat pp_provs
- else head pp_provs
+ = ifPprDebug (vcat pp_provs)
+ (head pp_provs)
where
pp_provs = pp_lcl ++ map pp_is iss
pp_lcl = if lcl then [text "defined at" <+> ppr (nameSrcLoc name)]
diff --git a/compiler/basicTypes/SrcLoc.hs b/compiler/basicTypes/SrcLoc.hs
index 1e6e7d2535..3d3db956d7 100644
--- a/compiler/basicTypes/SrcLoc.hs
+++ b/compiler/basicTypes/SrcLoc.hs
@@ -548,7 +548,7 @@ instance (Outputable l, Outputable e) => Outputable (GenLocated l e) where
-- GenLocated:
-- Print spans without the file name etc
-- ifPprDebug (braces (pprUserSpan False l))
- ifPprDebug (braces (ppr l))
+ whenPprDebug (braces (ppr l))
$$ ppr e
{-