[commit: ghc] master: Better comments and debug-print only (43c2ffe)

git at git.haskell.org git at git.haskell.org
Thu Oct 4 15:04:08 UTC 2018


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

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

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

commit 43c2ffe7c0ce85a8e1305cea3be453fd01de5b63
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Oct 3 13:27:06 2018 +0100

    Better comments and debug-print only


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

43c2ffe7c0ce85a8e1305cea3be453fd01de5b63
 compiler/typecheck/TcRnMonad.hs | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs
index aa95c1e..940e6a9 100644
--- a/compiler/typecheck/TcRnMonad.hs
+++ b/compiler/typecheck/TcRnMonad.hs
@@ -954,6 +954,8 @@ reportWarning reason err
 
 try_m :: TcRn r -> TcRn (Either IOEnvFailure r)
 -- Does tryM, with a debug-trace on failure
+-- If we do recover from an exception, /insoluble/ constraints
+-- (only) in 'thing' are are propagated
 try_m thing
   = do { (mb_r, lie) <- tryCaptureConstraints thing
        ; emitConstraints lie
@@ -961,7 +963,7 @@ try_m thing
        -- Debug trace
        ; case mb_r of
             Left exn -> traceTc "tryTc/recoverM recovering from" $
-                        text (showException exn)
+                        (text (showException exn) $$ ppr lie)
             Right {} -> return ()
 
        ; return mb_r }
@@ -972,6 +974,8 @@ recoverM :: TcRn r      -- Recovery action; do this if the main one fails
                         --  if it generates errors, propagate them all
          -> TcRn r
 -- Errors in 'thing' are retained
+-- If we do recover from an exception, /insoluble/ constraints
+-- (only) in 'thing' are are propagated
 recoverM recover thing
   = do { mb_res <- try_m thing ;
          case mb_res of
@@ -1483,7 +1487,7 @@ tryCaptureConstraints :: TcM a -> TcM (Either IOEnvFailure a, WantedConstraints)
 -- (captureConstraints_maybe m) runs m,
 -- and returns the type constraints it generates
 -- It never throws an exception; instead if thing_inside fails,
---   it returns Left exn and the insoluble constraints
+--   it returns Left exn and the /insoluble/ constraints
 tryCaptureConstraints thing_inside
   = do { lie_var <- newTcRef emptyWC
        ; mb_res <- tryM $



More information about the ghc-commits mailing list