[commit: ghc] master: Use throwGhcExceptionIO rather than throwGhcException in InteractiveEval.hs (1bb4913)

Ian Lynagh igloo at earth.li
Thu Jan 31 01:29:50 CET 2013


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

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/1bb4913c3c9b1942c014475e38f2f8cf8b61be68

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

commit 1bb4913c3c9b1942c014475e38f2f8cf8b61be68
Author: Ian Lynagh <ian at well-typed.com>
Date:   Wed Jan 30 13:53:47 2013 +0000

    Use throwGhcExceptionIO rather than throwGhcException in InteractiveEval.hs

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

 compiler/main/InteractiveEval.hs |   17 ++++++++++-------
 1 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/compiler/main/InteractiveEval.hs b/compiler/main/InteractiveEval.hs
index 4b23ad0..1d74c63 100644
--- a/compiler/main/InteractiveEval.hs
+++ b/compiler/main/InteractiveEval.hs
@@ -499,7 +499,8 @@ resume canLogSpan step
        resume = ic_resume ic
 
    case resume of
-     [] -> throwGhcException (ProgramError "not stopped at a breakpoint")
+     [] -> liftIO $
+           throwGhcExceptionIO (ProgramError "not stopped at a breakpoint")
      (r:rs) -> do
         -- unbind the temporary locals by restoring the TypeEnv from
         -- before the breakpoint, and drop this Resume from the
@@ -557,16 +558,17 @@ moveHist :: GhcMonad m => (Int -> Int) -> m ([Name], Int, SrcSpan)
 moveHist fn = do
   hsc_env <- getSession
   case ic_resume (hsc_IC hsc_env) of
-     [] -> throwGhcException (ProgramError "not stopped at a breakpoint")
+     [] -> liftIO $
+           throwGhcExceptionIO (ProgramError "not stopped at a breakpoint")
      (r:rs) -> do
         let ix = resumeHistoryIx r
             history = resumeHistory r
             new_ix = fn ix
         --
-        when (new_ix > length history) $
-           throwGhcException (ProgramError "no more logged breakpoints")
-        when (new_ix < 0) $
-           throwGhcException (ProgramError "already at the beginning of the history")
+        when (new_ix > length history) $ liftIO $
+           throwGhcExceptionIO (ProgramError "no more logged breakpoints")
+        when (new_ix < 0) $ liftIO $
+           throwGhcExceptionIO (ProgramError "already at the beginning of the history")
 
         let
           update_ic apStack mb_info = do
@@ -848,7 +850,8 @@ setContext imports
        ; let dflags = hsc_dflags hsc_env
        ; all_env_err <- liftIO $ findGlobalRdrEnv hsc_env imports
        ; case all_env_err of
-           Left (mod, err) -> throwGhcException (formatError dflags mod err)
+           Left (mod, err) ->
+               liftIO $ throwGhcExceptionIO (formatError dflags mod err)
            Right all_env -> do {
        ; let old_ic        = hsc_IC hsc_env
              final_rdr_env = ic_tythings old_ic `icPlusGblRdrEnv` all_env





More information about the ghc-commits mailing list