module System.Timeout ( timeout ) where
+#if __NHC__
+timeout :: Int -> IO a -> IO (Maybe a)
+timeout n f = fmap Just f
+#else
+
import Prelude (IO, Ord((<)), Eq((==)), Int, (.), otherwise, fmap)
import Data.Maybe (Maybe(..))
import Control.Monad (Monad(..), guard)
(bracket (forkIO (threadDelay n >> throwDynTo pid ex))
(killThread)
(\_ -> fmap Just f))
+#endif