{-# OPTIONS -#include "Linker.h" -#include "SchedAPI.h" #-}
-----------------------------------------------------------------------------
--- $Id: InteractiveUI.hs,v 1.118 2002/04/05 23:24:28 sof Exp $
+-- $Id: InteractiveUI.hs,v 1.121 2002/04/24 09:42:18 simonmar Exp $
--
-- GHC Interactive User Interface
--
Right hdl -> fileLoop hdl False
-- perform a :load for files given on the GHCi command line
- when (notNull paths) $
+ when (not (null paths)) $
ghciHandle showException $
loadModule (unwords paths)
checkPerms :: String -> IO Bool
checkPerms name =
- DriverUtil.handle (\_ -> return False) $ do
#ifdef mingw32_TARGET_OS
- doesFileExist name
+ return True
#else
+ DriverUtil.handle (\_ -> return False) $ do
st <- getFileStatus name
me <- getRealUserID
if fileOwner st /= me then do
if quit then return () else stringLoop ss
mkPrompt toplevs exports
- = concat (intersperse " " (toplevs ++ map ('*':) exports)) ++ "> "
+ = concat (intersperse " " (map ('*':) toplevs ++ exports)) ++ "> "
#if HAVE_READLINE_HEADERS && HAVE_READLINE_LIBS
readlineLoop :: GHCi ()
setCmState cms'
separate cmstate [] as bs = return (as,bs)
-separate cmstate (('*':m):ms) as bs = separate cmstate ms (m:as) bs
-separate cmstate (m:ms) as bs = do
+separate cmstate (('*':m):ms) as bs = do
b <- io (cmModuleIsInterpreted cmstate m)
- if b then separate cmstate ms as (m:bs)
+ if b then separate cmstate ms (m:as) bs
else throwDyn (CmdLineError ("module `" ++ m ++ "' is not interpreted"))
-
+separate cmstate (m:ms) as bs = separate cmstate ms as (m:bs)
+
prel = "Prelude"
leftovers <- processArgs dynamic_flags leftovers []
saveDynFlags
- if (notNull leftovers)
+ if (not (null leftovers))
then throwDyn (CmdLineError ("unrecognised flags: " ++
unwords leftovers))
else return ()
(minus_opts, rest1) = partition isMinus opts
(plus_opts, rest2) = partition isPlus rest1
- if (notNull rest2)
+ if (not (null rest2))
then io (putStrLn ("unknown option: `" ++ head rest2 ++ "'"))
else do
mapM unsetOpt plus_opts
-- can't do GHC flags for now
- if (notNull minus_opts)
+ if (not (null minus_opts))
then throwDyn (CmdLineError "can't unset GHC command-line flags")
else return ()
-- Packages that don't need loading, because the compiler shares them with
-- the interpreted program.
-dont_load_these = [ "gmp", "rts" ]
+dont_load_these = [ "rts" ]
-- Packages that are already linked into GHCi. For mingw32, we only
-- skip gmp and rts, since std and after need to load the msvcrt.dll