Add tests from testsuite/tests/h98
[ghc-base.git] / System / Timeout.hs
index f27a936..df33625 100644 (file)
@@ -1,3 +1,8 @@
+{-# LANGUAGE CPP #-}
+#ifdef __GLASGOW_HASKELL__
+{-# LANGUAGE DeriveDataTypeable, StandaloneDeriving #-}
+#endif
+
 -------------------------------------------------------------------------------
 -- |
 -- Module      :  System.Timeout
@@ -27,13 +32,12 @@ import Control.Concurrent  (forkIO, threadDelay, myThreadId, killThread)
 import Control.Exception   (Exception, handleJust, throwTo, bracket)
 import Data.Typeable
 import Data.Unique         (Unique, newUnique)
-import GHC.Num
 
 -- An internal type that is thrown as a dynamic exception to
 -- 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