[commit: ghc] master: Fix pretty-printer for IfaceCo (24194a6)
git at git.haskell.org
git at git.haskell.org
Thu Jun 30 07:25:16 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/24194a6aed950ed4c3733e3c582abf8a15d98ffd/ghc
>---------------------------------------------------------------
commit 24194a6aed950ed4c3733e3c582abf8a15d98ffd
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date: Wed Jun 29 23:21:49 2016 +0100
Fix pretty-printer for IfaceCo
As Trac #12242 showed, there was a missing case in
the pretty printer for IfaceCo. I've refactored it
so that the pattern-match ovelap checker will spot
it next time.
>---------------------------------------------------------------
24194a6aed950ed4c3733e3c582abf8a15d98ffd
compiler/iface/IfaceType.hs | 27 ++++++++++++++++-----------
1 file changed, 16 insertions(+), 11 deletions(-)
diff --git a/compiler/iface/IfaceType.hs b/compiler/iface/IfaceType.hs
index 27f2776..f200872 100644
--- a/compiler/iface/IfaceType.hs
+++ b/compiler/iface/IfaceType.hs
@@ -910,17 +910,22 @@ ppr_co ctxt_prec (IfaceInstCo co ty)
ppr_co ctxt_prec (IfaceAxiomRuleCo tc cos)
= maybeParen ctxt_prec TyConPrec $ ppr tc <+> parens (interpp'SP cos)
-ppr_co ctxt_prec co
- = ppr_special_co ctxt_prec doc cos
- where (doc, cos) = case co of
- { IfaceAxiomInstCo n i cos -> (ppr n <> brackets (ppr i), cos)
- ; IfaceSymCo co -> (text "Sym", [co])
- ; IfaceTransCo co1 co2 -> (text "Trans", [co1,co2])
- ; IfaceNthCo d co -> (text "Nth:" <> int d,
- [co])
- ; IfaceLRCo lr co -> (ppr lr, [co])
- ; IfaceSubCo co -> (text "Sub", [co])
- ; _ -> panic "pprIfaceCo" }
+ppr_co ctxt_prec (IfaceAxiomInstCo n i cos)
+ = ppr_special_co ctxt_prec (ppr n <> brackets (ppr i)) cos
+ppr_co ctxt_prec (IfaceSymCo co)
+ = ppr_special_co ctxt_prec (text "Sym") [co]
+ppr_co ctxt_prec (IfaceTransCo co1 co2)
+ = ppr_special_co ctxt_prec (text "Trans") [co1,co2]
+ppr_co ctxt_prec (IfaceNthCo d co)
+ = ppr_special_co ctxt_prec (text "Nth:" <> int d) [co]
+ppr_co ctxt_prec (IfaceLRCo lr co)
+ = ppr_special_co ctxt_prec (ppr lr) [co]
+ppr_co ctxt_prec (IfaceSubCo co)
+ = ppr_special_co ctxt_prec (text "Sub") [co]
+ppr_co ctxt_prec (IfaceCoherenceCo co1 co2)
+ = ppr_special_co ctxt_prec (text "Coh") [co1,co2]
+ppr_co ctxt_prec (IfaceKindCo co)
+ = ppr_special_co ctxt_prec (text "Kind") [co]
ppr_special_co :: TyPrec -> SDoc -> [IfaceCoercion] -> SDoc
ppr_special_co ctxt_prec doc cos
More information about the ghc-commits
mailing list