Commit 6e0c0fd2 authored by Simon Peyton Jones's avatar Simon Peyton Jones

Improve debug printing/warnings

parent b7e5c302
......@@ -1773,7 +1773,9 @@ instance Outputable Ct where
CTyEqCan {} -> text "CTyEqCan"
CFunEqCan {} -> text "CFunEqCan"
CNonCanonical {} -> text "CNonCanonical"
CDictCan {} -> text "CDictCan"
CDictCan { cc_pend_sc = pend_sc }
| pend_sc -> text "CDictCan(psc)"
| otherwise -> text "CDictCan"
CIrredEvCan {} -> text "CIrredEvCan"
CHoleCan { cc_occ = occ } -> text "CHoleCan:" <+> ppr occ
......
......@@ -13,7 +13,8 @@ module TcSMonad (
updWorkListTcS,
-- The TcS monad
TcS, runTcS, runTcSDeriveds, runTcSWithEvBinds, failTcS,
TcS, runTcS, runTcSDeriveds, runTcSWithEvBinds,
failTcS, warnTcS,
runTcSEqualities,
nestTcS, nestImplicTcS,
......@@ -2319,7 +2320,9 @@ wrapWarnTcS :: TcM a -> TcS a
wrapWarnTcS = wrapTcS
failTcS, panicTcS :: SDoc -> TcS a
warnTcS :: SDoc -> TcS ()
failTcS = wrapTcS . TcM.failWith
warnTcS = wrapTcS . TcM.addWarn
panicTcS doc = pprPanic "TcCanonical" doc
traceTcS :: String -> SDoc -> TcS ()
......
......@@ -1018,7 +1018,7 @@ simpl_loop n limit floated_eqs no_new_scs
= return wc -- Done!
| n `intGtLimit` limit
= failTcS (hang (ptext (sLit "solveWanteds: too many iterations")
= do { warnTcS (hang (ptext (sLit "solveWanteds: too many iterations")
<+> parens (ptext (sLit "limit =") <+> ppr limit))
2 (vcat [ ptext (sLit "Unsolved:") <+> ppr wc
, ppUnless (isEmptyBag floated_eqs) $
......@@ -1027,6 +1027,7 @@ simpl_loop n limit floated_eqs no_new_scs
ptext (sLit "New superclasses found")
, ptext (sLit "Set limit with -fconstraint-solver-iterations=n; n=0 for no limit")
]))
; return wc }
| otherwise
= do { traceTcS "simpl_loop, iteration" (int n)
......
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