import PrelAddr
import PrelIOBase ( IOError(..), IOErrorType(..), constructErrorAndFailWithInfo, stToIO )
import PrelPack ( unpackCString, unpackCStringST, packString )
-import PrelArr ( ByteArray )
+import PrelByteArr ( ByteArray )
type PrimByteArray = ByteArray Int
--
-- Suitable for use with Hugs 98
-----------------------------------------------------------------------------
+import PrelPrim ( primGetRawArgs
+ , primGetEnv
+ , prelCleanupAfterRunAction
+ , copy_String_to_cstring
+ , readIORef
+ , nh_stderr
+ , nh_stdout
+ , nh_stdin
+ , nh_exitwith
+ , nh_flush
+ , nh_close
+ , nh_system
+ , nh_free
+ , nh_getPID
+ )
+
data ExitCode = ExitSuccess | ExitFailure Int
deriving (Eq, Ord, Read, Show)
getArgs :: IO [String]
getArgs = primGetRawArgs >>= \rawargs ->
- return (drop 1 (dropWhile (/= "--") rawargs))
+ return (tail rawargs)
getProgName :: IO String
getProgName = primGetRawArgs >>= \rawargs ->
-- see comment in Prelude.hs near primRunIO_hugs_toplevel
exitWith :: ExitCode -> IO a
exitWith c
- = do cleanup_action <- readIORef prelExitWithAction
+ = do cleanup_action <- readIORef prelCleanupAfterRunAction
case cleanup_action of
Just xx -> xx
Nothing -> return ()