X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=compiler%2Fghci%2FGhciMonad.hs;h=f7c5c019b0768484892cde9a682e9eff42f51500;hb=9608803049b49cacef9c452d079693a1111be036;hp=3dcdce1732d122ade5396d0566642f40bfed60e1;hpb=28a5c73a83e8f27c31cad02da07c81e4e6764303;p=ghc-hetmet.git diff --git a/compiler/ghci/GhciMonad.hs b/compiler/ghci/GhciMonad.hs index 3dcdce1..f7c5c01 100644 --- a/compiler/ghci/GhciMonad.hs +++ b/compiler/ghci/GhciMonad.hs @@ -28,13 +28,11 @@ import StaticFlags import Data.Maybe import Numeric -import Control.Exception as Exception import Data.Array import Data.Char import Data.Int ( Int64 ) import Data.IORef import Data.List -import Data.Typeable import System.CPUTime import System.Directory import System.Environment @@ -70,7 +68,7 @@ data GHCiState = GHCiState remembered_ctx :: [(CtxtCmd, [String], [String])], -- we remember the :module commands between :loads, so that -- on a :reload we can replay them. See bugs #2049, - -- #1873, #1360. Previously we tried to remember modules that + -- \#1873, #1360. Previously we tried to remember modules that -- were supposed to be in the context but currently had errors, -- but this was complicated. Just replaying the :module commands -- seems to be the right thing. @@ -140,9 +138,9 @@ instance Monad GHCi where instance Functor GHCi where fmap f m = m >>= return . f -ghciHandleDyn :: Typeable t => (t -> GHCi a) -> GHCi a -> GHCi a -ghciHandleDyn h (GHCi m) = GHCi $ \s -> - Exception.catchDyn (m s) (\e -> unGHCi (h e) s) +ghciHandleGhcException :: (GhcException -> GHCi a) -> GHCi a -> GHCi a +ghciHandleGhcException h (GHCi m) = GHCi $ \s -> + handleGhcException (\e -> unGHCi (h e) s) (m s) getGHCiState :: GHCi GHCiState getGHCiState = GHCi $ \r -> readIORef r