Fix compilation breakage with GHC 4.08.x.
-----------------------------------------------------------------------------
--- $Id: DriverUtil.hs,v 1.35 2002/10/17 14:26:18 simonmar Exp $
+-- $Id: DriverUtil.hs,v 1.36 2003/03/04 10:39:58 simonmar Exp $
--
-- Utils for the driver
--
import Panic
import Config ( cLeadingUnderscore )
-import EXCEPTION as Exception
+import EXCEPTION ( Exception, finally, throwDyn, catchDyn )
+import qualified EXCEPTION as Exception
import DYNAMIC
import DATA_IOREF ( IORef, readIORef, writeIORef )
import DATA_IOREF ( IORef, newIORef, readIORef, writeIORef )
import UNSAFE_IO ( unsafeInterleaveIO )
import FIX_IO ( fixIO )
-import EXCEPTION ( Exception(..), tryJust )
+import EXCEPTION ( Exception(..) )
import IO ( isUserError )
import Maybe ( mapMaybe )
import ListSetOps ( unionLists )
+import Panic ( tryJust )
\end{code}
-- Reflect exception into TcRn monad
tryM (TcRn thing) = TcRn (\ env -> tryJust tc_errors (thing env))
where
-#if __GLASGOW_HASKELL__ > 504
+#if __GLASGOW_HASKELL__ > 504 || __GLASGOW_HASKELL__ < 500
tc_errors e@(IOException ioe) | isUserError ioe = Just e
#else
tc_errors e@(IOException _) | isUserError e = Just e
showException, showGhcException, tryMost,
installSignalHandlers,
-#if __GLASGOW_HASKELL__ <= 408
- catchJust, ioErrors, throwTo,
-#endif
+ catchJust, tryJust, ioErrors, throwTo,
) where
#include "HsVersions.h"
# endif /* GHC < 500 */
#endif /* mingw32_HOST_OS */
+#if __GLASGOW_HASKELL__ > 408
+import EXCEPTION ( catchJust, tryJust, ioErrors )
+#endif
+
import DYNAMIC
import qualified EXCEPTION as Exception
import TRACE ( trace )
\begin{code}
#if __GLASGOW_HASKELL__ <= 408
catchJust = Exception.catchIO
+tryJust = Exception.tryIO
ioErrors = Exception.justIoErrors
throwTo = Exception.raiseInThread
#endif