From 03803f88cccbee0d2a4180015fffa02a803c20d6 Mon Sep 17 00:00:00 2001 From: Simon Marlow Date: Tue, 9 May 2006 08:31:24 +0000 Subject: [PATCH] make it possible to define an alias for :quit --- compiler/ghci/InteractiveUI.hs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/compiler/ghci/InteractiveUI.hs b/compiler/ghci/InteractiveUI.hs index d45bddc..d92cc53 100644 --- a/compiler/ghci/InteractiveUI.hs +++ b/compiler/ghci/InteractiveUI.hs @@ -460,13 +460,13 @@ fileLoop hdl show_prompt = do l -> do quit <- runCommand l if quit then return () else fileLoop hdl show_prompt -stringLoop :: [String] -> GHCi () -stringLoop [] = return () +stringLoop :: [String] -> GHCi Bool{-True: we quit-} +stringLoop [] = return False stringLoop (s:ss) = do case removeSpaces s of "" -> stringLoop ss l -> do quit <- runCommand l - if quit then return () else stringLoop ss + if quit then return True else stringLoop ss mkPrompt toplevs exports prompt = showSDoc $ f prompt @@ -749,9 +749,9 @@ defineMacro s = do case maybe_hv of Nothing -> return () Just hv -> io (writeIORef commands -- - (cmds ++ [(macro_name, keepGoing (runMacro hv), False, completeNone)])) + (cmds ++ [(macro_name, runMacro hv, False, completeNone)])) -runMacro :: GHC.HValue{-String -> IO String-} -> String -> GHCi () +runMacro :: GHC.HValue{-String -> IO String-} -> String -> GHCi Bool runMacro fun s = do str <- io ((unsafeCoerce# fun :: String -> IO String) s) stringLoop (lines str) -- 1.7.10.4