X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=System%2FTimeout.hs;fp=System%2FTimeout.hs;h=0e82704a850b9996b5fa6ea7529349ca4ea57145;hb=a2bcd1899dea9b266b7c795e391f658985deda2e;hp=634b3548afcc156e6156a1af8c7318b14a531b05;hpb=e7a5a94532447b071406f8e7ee6f6ae626d2d754;p=ghc-base.git diff --git a/System/Timeout.hs b/System/Timeout.hs index 634b354..0e82704 100644 --- a/System/Timeout.hs +++ b/System/Timeout.hs @@ -12,6 +12,8 @@ -- ------------------------------------------------------------------------------- +#include "Typeable.h" + module System.Timeout ( timeout ) where #if __NHC__ @@ -26,13 +28,15 @@ import Control.Monad (Monad(..), guard) 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) -- 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, Typeable) +data Timeout = Timeout Unique deriving Eq +INSTANCE_TYPEABLE0(Timeout,timeoutTc,"Timeout") instance Show Timeout where show _ = "<>"