Generalise 'handleGhcException' to work with any 'ExceptionMonad'.
authorThomas Schilling <nominolo@googlemail.com>
Sun, 14 Sep 2008 17:24:04 +0000 (17:24 +0000)
committerThomas Schilling <nominolo@googlemail.com>
Sun, 14 Sep 2008 17:24:04 +0000 (17:24 +0000)
compiler/utils/Panic.lhs

index f2e6312..6f7a4a8 100644 (file)
@@ -136,11 +136,11 @@ throwGhcException = Exception.throwDyn
 throwGhcException = Exception.throw
 #endif
 
-handleGhcException :: (GhcException -> IO a) -> IO a -> IO a
+handleGhcException :: ExceptionMonad m => (GhcException -> m a) -> m a -> m a
 #if __GLASGOW_HASKELL__ < 609
-handleGhcException = flip Exception.catchDyn
+handleGhcException = flip gcatchDyn
 #else
-handleGhcException = Exception.handle
+handleGhcException = ghandle
 #endif
 
 ghcExceptionTc :: TyCon