Commit aafdba3b authored by chak@cse.unsw.edu.au.'s avatar chak@cse.unsw.edu.au.
Browse files

Properly ppr InstEqs in wanteds of implication constraints

parent 97169c5d
...@@ -603,11 +603,14 @@ pprInst i@(EqInst {tci_left = ty1, tci_right = ty2, tci_co = co}) ...@@ -603,11 +603,14 @@ pprInst i@(EqInst {tci_left = ty1, tci_right = ty2, tci_co = co})
(\covar -> text "Wanted" <+> ppr (TyVarTy covar) <+> dcolon <+> ppr (EqPred ty1 ty2)) (\covar -> text "Wanted" <+> ppr (TyVarTy covar) <+> dcolon <+> ppr (EqPred ty1 ty2))
(\co -> text "Given" <+> ppr co <+> dcolon <+> ppr (EqPred ty1 ty2)) (\co -> text "Given" <+> ppr co <+> dcolon <+> ppr (EqPred ty1 ty2))
pprInst inst = ppr (instName inst) <+> dcolon pprInst inst = ppr (instName inst) <+> dcolon
<+> (braces (ppr (instType inst)) $$ <+> (braces (ppr (instType inst) <> implicWantedEqs) $$
ifPprDebug implic_stuff) ifPprDebug implic_stuff)
where where
implic_stuff | isImplicInst inst = ppr (tci_reft inst) (implic_stuff, implicWantedEqs)
| otherwise = empty | isImplicInst inst = (ppr (tci_reft inst),
text " &" <+>
ppr (filter isEqInst (tci_wanted inst)))
| otherwise = (empty, empty)
pprInstInFull inst@(EqInst {}) = pprInst inst pprInstInFull inst@(EqInst {}) = pprInst inst
pprInstInFull inst = sep [quotes (pprInst inst), nest 2 (pprInstArising inst)] pprInstInFull inst = sep [quotes (pprInst inst), nest 2 (pprInstArising inst)]
......
...@@ -663,7 +663,7 @@ data Inst ...@@ -663,7 +663,7 @@ data Inst
tci_reft :: Refinement, tci_reft :: Refinement,
tci_given :: [Inst], -- Only Dicts and EqInsts tci_given :: [Inst], -- Only Dicts and EqInsts
-- (no Methods, LitInsts, ImplicInsts) -- (no Methods, LitInsts, ImplicInsts)
tci_wanted :: [Inst], -- Only Dicts and ImplicInsts tci_wanted :: [Inst], -- Only Dicts, EqInst, and ImplicInsts
-- (no Methods or LitInsts) -- (no Methods or LitInsts)
tci_loc :: InstLoc tci_loc :: InstLoc
......
...@@ -1022,8 +1022,9 @@ makeImplicationBind loc all_tvs reft ...@@ -1022,8 +1022,9 @@ makeImplicationBind loc all_tvs reft
pat_rhs = unguardedGRHSs rhs, pat_rhs = unguardedGRHSs rhs,
pat_rhs_ty = tup_ty, pat_rhs_ty = tup_ty,
bind_fvs = placeHolderNames } bind_fvs = placeHolderNames }
; -- pprTrace "Make implic inst" (ppr (implic_inst,irreds,dict_irreds,tup_ty)) $ ; traceTc $ text "makeImplicationBind" <+> ppr implic_inst
return ([implic_inst], unitBag (L span bind)) } ; return ([implic_inst], unitBag (L span bind))
}
----------------------------------------------------------- -----------------------------------------------------------
tryHardCheckLoop :: SDoc tryHardCheckLoop :: SDoc
...@@ -1848,7 +1849,7 @@ reduceContext env wanteds ...@@ -1848,7 +1849,7 @@ reduceContext env wanteds
text "----", text "----",
text "avails" <+> pprAvails avails, text "avails" <+> pprAvails avails,
text "improved =" <+> ppr improved, text "improved =" <+> ppr improved,
text "irreds = " <+> ppr irreds, text "(all) irreds = " <+> ppr all_irreds,
text "binds = " <+> ppr binds, text "binds = " <+> ppr binds,
text "needed givens = " <+> ppr needed_givens, text "needed givens = " <+> ppr needed_givens,
text "----------------------" text "----------------------"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment