Repository : ssh://darcs.haskell.org//srv/darcs/ghc

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/316d3edcdd6ebb3126956e35d9360bebdf5efda8

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

commit 316d3edcdd6ebb3126956e35d9360bebdf5efda8
Author: Simon Peyton Jones <[email protected]>
Date:   Mon Oct 1 11:26:04 2012 +0100

    Tracing in TcUnify

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

 compiler/typecheck/TcUnify.lhs |   14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcUnify.lhs b/compiler/typecheck/TcUnify.lhs
index 65e7871..88dbd7f 100644
--- a/compiler/typecheck/TcUnify.lhs
+++ b/compiler/typecheck/TcUnify.lhs
@@ -767,7 +767,9 @@ uUnfilledVar origin swapped tv1 details1 non_var_ty2  -- 
ty2 is not a type varia
       MetaTv { mtv_info = TauTv, mtv_ref = ref1 }
         -> do { mb_ty2' <- checkTauTvUpdate tv1 non_var_ty2
               ; case mb_ty2' of
-                  Nothing   -> do { traceTc "Occ/kind defer" (ppr tv1); defer }
+                  Nothing   -> do { traceTc "Occ/kind defer" (ppr tv1 <+> 
dcolon <+> ppr (tyVarKind tv1)
+                                                              $$ ppr 
non_var_ty2 $$ ppr (typeKind non_var_ty2))
+                                  ; defer }
                   Just ty2' -> updateMeta tv1 ref1 ty2'
               }
 
@@ -854,9 +856,17 @@ checkTauTvUpdate :: TcTyVar -> TcType -> TcM (Maybe TcType)
 -- we return Nothing, leaving it to the later constraint simplifier to
 -- sort matters out.
 
+-- Used in debug meesages only
+_ppr_sub :: Maybe Ordering -> SDoc
+_ppr_sub (Just LT) = text "LT"
+_ppr_sub (Just EQ) = text "EQ"
+_ppr_sub (Just GT) = text "GT"
+_ppr_sub Nothing   = text "Nothing"
+
 checkTauTvUpdate tv ty
   = do { ty'   <- zonkTcType ty
        ; sub_k <- unifyKindX (tyVarKind tv) (typeKind ty')
+--       ; traceTc "checktttv" (ppr tv $$ ppr ty' $$ ppr (tyVarKind tv) $$ ppr 
(typeKind ty') $$ _ppr_sub sub_k)
        ; case sub_k of
            Nothing -> return Nothing
            Just LT -> return Nothing
@@ -920,7 +930,7 @@ function @occ_check_ok@.
 
 
 Note [Type family sharing]
-~~~~~~~~~~~~~~ 
+~~~~~~~~~~~~~~~~~~~~~~~~~~ 
 We must avoid eagerly unifying type variables to types that contain function 
symbols, 
 because this may lead to loss of sharing, and in turn, in very poor 
performance of the
 constraint simplifier. Assume that we have a wanted constraint: 



_______________________________________________
Cvs-ghc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-ghc

Reply via email to