Add tests from testsuite/tests/h98
[ghc-base.git] / System / Timeout.hs
index 9ccc634..df33625 100644 (file)
@@ -1,3 +1,8 @@
+{-# LANGUAGE CPP #-}
+#ifdef __GLASGOW_HASKELL__
+{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}
+#endif
+
 -------------------------------------------------------------------------------
 -- |
 -- Module      :  System.Timeout
@@ -20,12 +25,11 @@ module System.Timeout ( timeout ) where
 
 #ifdef __GLASGOW_HASKELL__
 import Prelude             (Show(show), IO, Ord((<)), Eq((==)), Int,
-                            (.), otherwise, fmap)
+                            otherwise, fmap)
 import Data.Maybe          (Maybe(..))
-import Control.Monad       (Monad(..), guard)
+import Control.Monad       (Monad(..))
 import Control.Concurrent  (forkIO, threadDelay, myThreadId, killThread)
 import Control.Exception   (Exception, handleJust, throwTo, bracket)
-import Data.Dynamic        (Typeable, fromDynamic)
 import Data.Typeable
 import Data.Unique         (Unique, newUnique)
 
@@ -33,7 +37,7 @@ import Data.Unique         (Unique, newUnique)
 -- interrupt the running IO computation when the timeout has
 -- expired.
 
-data Timeout = Timeout Unique deriving Eq
+newtype Timeout = Timeout Unique deriving Eq
 INSTANCE_TYPEABLE0(Timeout,timeoutTc,"Timeout")
 
 instance Show Timeout where