[commit: ghc] master: Improve tracing in checkValidInstance (f7e0e5f)

git at git.haskell.org git at git.haskell.org
Mon Jan 25 11:31:26 UTC 2016


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/f7e0e5f957f1b061eda057282504fca3de061220/ghc

>---------------------------------------------------------------

commit f7e0e5f957f1b061eda057282504fca3de061220
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Mon Jan 25 08:31:51 2016 +0000

    Improve tracing in checkValidInstance


>---------------------------------------------------------------

f7e0e5f957f1b061eda057282504fca3de061220
 compiler/typecheck/TcValidity.hs | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/compiler/typecheck/TcValidity.hs b/compiler/typecheck/TcValidity.hs
index 1866f51..3aa8d78 100644
--- a/compiler/typecheck/TcValidity.hs
+++ b/compiler/typecheck/TcValidity.hs
@@ -1149,6 +1149,7 @@ checkValidInstance ctxt hs_type ty
   | Just (clas,inst_tys) <- getClassPredTys_maybe tau
   , inst_tys `lengthIs` classArity clas
   = do  { setSrcSpan head_loc (checkValidInstHead ctxt clas inst_tys)
+        ; traceTc "checkValidInstance {" (ppr ty)
         ; checkValidTheta ctxt theta
 
         -- The Termination and Coverate Conditions
@@ -1162,15 +1163,18 @@ checkValidInstance ctxt hs_type ty
         --   the termination condition, because 'a' appears more often
         --   in the constraint than in the head
         ; undecidable_ok <- xoptM LangExt.UndecidableInstances
-        ; traceTc "cvi" (ppr undecidable_ok $$ ppr ty)
         ; if undecidable_ok
           then checkAmbiguity ctxt ty
           else checkInstTermination inst_tys theta
 
+        ; traceTc "cvi 2" (ppr ty)
+
         ; case (checkInstCoverage undecidable_ok clas theta inst_tys) of
             IsValid      -> return ()   -- Check succeeded
             NotValid msg -> addErrTc (instTypeErr clas inst_tys msg)
 
+        ; traceTc "End checkValidInstance }" empty
+
         ; return (tvs, theta, clas, inst_tys) }
 
   | otherwise



More information about the ghc-commits mailing list