Hugs: use the same version of fixIO as GHC
#ifdef __HUGS__
import Hugs.IO
import Hugs.IOExts
#ifdef __HUGS__
import Hugs.IO
import Hugs.IOExts
+import Hugs.IORef
+import Hugs.Prelude ( throw, Exception(NonTermination) )
+import System.IO.Unsafe ( unsafeInterleaveIO )
-- ---------------------------------------------------------------------------
-- fixIO
-- ---------------------------------------------------------------------------
-- fixIO
-#ifdef __GLASGOW_HASKELL__
+#if defined(__GLASGOW_HASKELL__) || defined(__HUGS__)
fixIO :: (a -> IO a) -> IO a
fixIO k = do
ref <- newIORef (throw NonTermination)
fixIO :: (a -> IO a) -> IO a
fixIO k = do
ref <- newIORef (throw NonTermination)