projects
/
ghc-hetmet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
06f6f35
)
Improve pretty-printing for Insts
author
simonpj@microsoft.com
<unknown>
Wed, 28 Nov 2007 17:31:25 +0000
(17:31 +0000)
committer
simonpj@microsoft.com
<unknown>
Wed, 28 Nov 2007 17:31:25 +0000
(17:31 +0000)
compiler/typecheck/Inst.lhs
patch
|
blob
|
history
diff --git
a/compiler/typecheck/Inst.lhs
b/compiler/typecheck/Inst.lhs
index
da80df4
..
5e9d985
100644
(file)
--- a/
compiler/typecheck/Inst.lhs
+++ b/
compiler/typecheck/Inst.lhs
@@
-94,6
+94,7
@@
import DynFlags
import Bag
import Maybes
import Util
import Bag
import Maybes
import Util
+import Unique
import Outputable
import Data.List
import TypeRep
import Outputable
import Data.List
import TypeRep
@@
-602,10
+603,11
@@
pprInst i@(EqInst {tci_left = ty1, tci_right = ty2, tci_co = co})
= eitherEqInst i
(\covar -> text "Wanted" <+> ppr (TyVarTy covar) <+> dcolon <+> ppr (EqPred ty1 ty2))
(\co -> text "Given" <+> ppr co <+> dcolon <+> ppr (EqPred ty1 ty2))
= eitherEqInst i
(\covar -> text "Wanted" <+> ppr (TyVarTy covar) <+> dcolon <+> ppr (EqPred ty1 ty2))
(\co -> text "Given" <+> ppr co <+> dcolon <+> ppr (EqPred ty1 ty2))
-pprInst inst = ppr (instName inst) <+> dcolon
+pprInst inst = ppr name <> braces (pprUnique (getUnique name)) <+> dcolon
<+> (braces (ppr (instType inst) <> implicWantedEqs) $$
ifPprDebug implic_stuff)
where
<+> (braces (ppr (instType inst) <> implicWantedEqs) $$
ifPprDebug implic_stuff)
where
+ name = instName inst
(implic_stuff, implicWantedEqs)
| isImplicInst inst = (ppr (tci_reft inst),
text " &" <+>
(implic_stuff, implicWantedEqs)
| isImplicInst inst = (ppr (tci_reft inst),
text " &" <+>