hugsprimEqChar,
fromDouble,
hugsprimMkIO,
- hugsprimCreateAdjThunk
+ hugsprimCreateAdjThunk,
+ hugsprimUnpackString
)
where
import PrelGHC
import PrelNum
import PrelReal(Integral)
import Prelude(fromIntegral)
-import IO(putStr)
+import IO(putStr,hFlush,stdout,stderr)
import PrelException(catch)
import PrelIOBase(IO,unsafePerformIO)
import PrelShow(show)
import PrelReal(Fractional,fromRational,toRational)
import PrelAddr(Addr)
import PrelErr(error)
+import PrelPack(unpackCString)
-- Stuff needed by Hugs for desugaring. Do not mess with these!
-- They need to correspond exactly to versions written in
hugsprimPmLe :: Integral a => a -> a -> Bool
hugsprimPmLe x y = x <= y
+hugsprimUnpackString :: Addr -> String
+hugsprimUnpackString a = unpackCString a
+
+
-- used when Hugs invokes top level function
{-
hugsprimRunIO_toplevel :: IO a -> ()
hugsprimRunIO_toplevel :: IO a -> ()
hugsprimRunIO_toplevel m
= unsafePerformIO (
- catch (m >> return ())
+ catch (m >> hFlush stderr >> hFlush stdout)
(\e -> putStr (show e ++ "\n"))
)
+
\end{code}
\ No newline at end of file