From: simonpj@microsoft.com Date: Wed, 28 Nov 2007 17:31:25 +0000 (+0000) Subject: Improve pretty-printing for Insts X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=12d8935ec994db50dc5c0451abb6c35a823ed918 Improve pretty-printing for Insts --- diff --git a/compiler/typecheck/Inst.lhs b/compiler/typecheck/Inst.lhs index da80df4..5e9d985 100644 --- a/compiler/typecheck/Inst.lhs +++ b/compiler/typecheck/Inst.lhs @@ -94,6 +94,7 @@ import DynFlags import Bag import Maybes import Util +import Unique 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)) -pprInst inst = ppr (instName inst) <+> dcolon +pprInst inst = ppr name <> braces (pprUnique (getUnique name)) <+> dcolon <+> (braces (ppr (instType inst) <> implicWantedEqs) $$ ifPprDebug implic_stuff) where + name = instName inst (implic_stuff, implicWantedEqs) | isImplicInst inst = (ppr (tci_reft inst), text " &" <+>