Don't use "deriving Typeable" (for portability reasons)
[ghc-base.git] / System / IO.hs
index f379078..93166b9 100644 (file)
@@ -1,4 +1,4 @@
-{-# OPTIONS_GHC -fno-implicit-prelude #-}
+{-# OPTIONS_GHC -XNoImplicitPrelude #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  System.IO
@@ -161,6 +161,8 @@ module System.IO (
     openBinaryTempFile,
   ) where
 
+import Control.Exception hiding (bracket)
+
 #ifndef __NHC__
 import Data.Bits
 import Data.List
@@ -171,7 +173,7 @@ import System.Posix.Internals
 #endif
 
 #ifdef __GLASGOW_HASKELL__
-import GHC.Exception    as ExceptionBase hiding (catch)
+import GHC.IOBase       as ExceptionBase
 #endif
 #ifdef __HUGS__
 import Hugs.Exception   as ExceptionBase
@@ -490,7 +492,7 @@ openTempFile' loc tmp_dir template binary = do
          -- as any exceptions etc will only be able to report the
          -- fd currently
          h <- fdToHandle fd
-                `ExceptionBase.catchException` \e -> do c_close fd; throw e
+                `ExceptionBase.catchAny` \e -> do c_close fd; throw e
          return (filepath, h)
 #endif
       where
@@ -562,7 +564,7 @@ bracket
 bracket before after thing =
   block (do
     a <- before
-    r <- catchException
+    r <- catchAny
            (unblock (thing a))
            (\e -> do { after a; throw e })
     after a