[commit: ghc] master: Improve pretty-printing of IfaceCoercions (6850eb6)

git at git.haskell.org git at git.haskell.org
Mon Jan 23 08:28:44 UTC 2017


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/6850eb64cc2312e53740edbd94ed2abd7d06f41e/ghc

>---------------------------------------------------------------

commit 6850eb64cc2312e53740edbd94ed2abd7d06f41e
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Fri Jan 20 23:37:21 2017 +0000

    Improve pretty-printing of IfaceCoercions
    
    For some reason, unless you have -fprint-explicit-coercions, when
    printing an explicit coercion we were then going to special trouble to
    suppress the unique of a hole (which only happens during debugging
    anyway).  This is bizarre.
    
    So I deleted three lines of code -- hooray.


>---------------------------------------------------------------

6850eb64cc2312e53740edbd94ed2abd7d06f41e
 compiler/iface/IfaceType.hs | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/compiler/iface/IfaceType.hs b/compiler/iface/IfaceType.hs
index 47f284e..0dded21 100644
--- a/compiler/iface/IfaceType.hs
+++ b/compiler/iface/IfaceType.hs
@@ -1135,12 +1135,8 @@ ppr_co ctxt_prec (IfaceUnivCo IfaceUnsafeCoerceProv r ty1 ty2)
     text "UnsafeCo" <+> ppr r <+>
     pprParendIfaceType ty1 <+> pprParendIfaceType ty2
 
-ppr_co ctxt_prec (IfaceUnivCo (IfaceHoleProv u) _ _ _)
- = maybeParen ctxt_prec TyConPrec $
-   sdocWithDynFlags $ \dflags ->
-     if gopt Opt_PrintExplicitCoercions dflags
-       then braces $ ppr u
-       else braces $ text "a hole"
+ppr_co _ctxt_prec (IfaceUnivCo (IfaceHoleProv u) _ _ _)
+ = braces $ ppr u
 
 ppr_co _         (IfaceUnivCo _ _ ty1 ty2)
   = angleBrackets ( ppr ty1 <> comma <+> ppr ty2 )



More information about the ghc-commits mailing list