summaryrefslogtreecommitdiff
path: root/compiler/GHC
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2021-06-01 13:15:29 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2021-06-17 10:04:06 +0100
commit228aa3144f1281d8c8f4deef0d4e667211a93bfa (patch)
tree315394247a4487042dc1ebf7b14987ce0329a595 /compiler/GHC
parentece22d672317e32f6dddeaadc0a2c2581249f79b (diff)
downloadhaskell-228aa3144f1281d8c8f4deef0d4e667211a93bfa.tar.gz
Improve pretty-printing of coercionswip/T19890
With -dsuppress-coercions, it's still good to be able to see the type of the coercion. This patch prints the type. Maybe we should have a flag to control this too.
Diffstat (limited to 'compiler/GHC')
-rw-r--r--compiler/GHC/Core/Ppr.hs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/GHC/Core/Ppr.hs b/compiler/GHC/Core/Ppr.hs
index cec4814441..cc3159d646 100644
--- a/compiler/GHC/Core/Ppr.hs
+++ b/compiler/GHC/Core/Ppr.hs
@@ -169,7 +169,7 @@ noParens pp = pp
pprOptCo :: Coercion -> SDoc
-- Print a coercion optionally; i.e. honouring -dsuppress-coercions
pprOptCo co = sdocOption sdocSuppressCoercions $ \case
- True -> angleBrackets (text "Co:" <> int (coercionSize co))
+ True -> angleBrackets (text "Co:" <> int (coercionSize co)) <+> dcolon <+> ppr (coercionType co)
False -> parens $ sep [ppr co, dcolon <+> ppr (coercionType co)]
ppr_id_occ :: (SDoc -> SDoc) -> Id -> SDoc