[project @ 2002-04-24 09:42:18 by simonmar]
[ghc-hetmet.git] / ghc / compiler / ghci / InteractiveUI.hs
index 8f69c06..8d3bd96 100644 (file)
@@ -1,6 +1,6 @@
 {-# 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
 --
@@ -234,7 +234,7 @@ runGHCi paths dflags = do
                  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)
 
@@ -273,10 +273,10 @@ interactiveLoop is_tty = do
 
 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
@@ -317,7 +317,7 @@ stringLoop (s:ss) = 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 ()
@@ -717,12 +717,12 @@ newContext mods = do
   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"
 
 
@@ -810,7 +810,7 @@ setOptions wds =
         leftovers <- processArgs dynamic_flags leftovers []
        saveDynFlags
 
-        if (notNull leftovers)
+        if (not (null leftovers))
                then throwDyn (CmdLineError ("unrecognised flags: " ++ 
                                                unwords leftovers))
                else return ()
@@ -823,14 +823,14 @@ unsetOptions str
           (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 ()
 
@@ -1063,7 +1063,7 @@ linkPackages dflags cmdline_lib_specs pkgs
 
 -- 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