Commit a4b1f3e2 authored by Bernd Brassel's avatar Bernd Brassel
Browse files

initialize readline

parent a402e539
......@@ -205,10 +205,10 @@ test: $(BIN)currytest
cd examples;./doTest
depend : $(SRC)MyReadline.hs
ghc -M $(HC_OPTS) $(SRCS)
$(GHC) -M $(HC_OPTS) $(SRCS)
%.hi: %.o %.hs
ghc --make $(HC_OPTS) $*.hs
$(GHC) --make $(HC_OPTS) $*.hs
# DO NOT DELETE: Beginning of Haskell dependencies
src/MyReadline.o : src/MyReadline.hs
......
module MyReadline (readline, addHistory) where
module MyReadline (readline, addHistory, initializeReadline) where
import System.IO
initializeReadline :: IO ()
initializeReadline =
putStrLn "no readline support. Consider cabal install readline"
readline s = putStr s >> hFlush stdout >> getLine >>= return . Just
addHistory _ = return ()
module MyReadline (readline, addHistory) where
module MyReadline (readline, addHistory,initializeReadline) where
import System.Console.Readline
initializeReadline :: IO ()
initializeReadline = return ()
......@@ -69,6 +69,7 @@ main = do
home <- getEnv "HOME"
(options,state) <- getOptions
mapM_ (safe . put 1 options) welcome
unless (verbosity options==0) initializeReadline
let files = case filename options of
"" -> ["Prelude"]
fn -> [fn]
......@@ -323,7 +324,10 @@ requestExpr state opts line = do
interactive state opts
-- in ghc 6.10 we cannot combine make with "-e"
-- In order to avoid link errors we somehow need
-- to start make before calling "-e", but it is not yet clear
-- how to avoid generating a binary.
requestCall state opts@Opts{eval=True} =
ghcCall opts{make=True,
ghcOpts=ghcOpts opts++ " +RTS "++ rts state ++ " -RTS -e main ",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment