summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2018-10-03 13:27:06 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2018-10-04 15:37:58 +0100
commit43c2ffe7c0ce85a8e1305cea3be453fd01de5b63 (patch)
treed4f7917e61edadb04ebd728c0c102417dc9aecd8
parente9e664022af66778bcc08f66ce3ba3b012c77ea4 (diff)
downloadhaskell-43c2ffe7c0ce85a8e1305cea3be453fd01de5b63.tar.gz
Better comments and debug-print only
-rw-r--r--compiler/typecheck/TcRnMonad.hs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/typecheck/TcRnMonad.hs b/compiler/typecheck/TcRnMonad.hs
index aa95c1eb2e..940e6a93ad 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 $