Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
curry
kics
Commits
a4b1f3e2
Commit
a4b1f3e2
authored
Jul 10, 2009
by
Bernd Brassel
Browse files
initialize readline
parent
a402e539
Changes
4
Hide whitespace changes
Inline
Side-by-side
Makefile
View file @
a4b1f3e2
...
...
@@ -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
...
...
src/NoReadline.make
View file @
a4b1f3e2
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
()
src/WithReadline.make
View file @
a4b1f3e2
module
MyReadline
(readline,
addHistory)
where
module
MyReadline
(readline,
addHistory
,initializeReadline
)
where
import
System.Console.Readline
initializeReadline
::
IO ()
initializeReadline
=
return
()
src/kicsi.hs
View file @
a4b1f3e2
...
...
@@ -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 "
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment