[Haskell-begin] invoking GHCi programtically ?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Haskell-begin] invoking GHCi programtically ?

Krassimir Krustev
Is it possible to invoke GHCi from Haskell code?
I want to achieve the following effect:

have a shell script invoke
runhaskell myprog.hs < input.dat

and at some point (on conditions) have the prog bring me the ghci prompt

GHCi
Main>

so I can examine my program state   interctively, for example place
breakpoints, run my functions piecewise?
and then do


GHCi
Main>:continue

and then have the prompt again (if conditions)
GHCi
Main>

I did try

ghci myprog.hs < input.dat

Command-line arguments
ghci myprog.hs a b c
are similarly by ghci not acceptable

In the overall, I want to have the stdin redirected from file once in
the GHCi session, place breakpoints and do :step(s) with that stream
in this way

and cannot also do
GHCi
Main>:main < input.dat
but in my case (I think) this not also an option since its not me but
the wrapper script doing the setup.

krassi
Reply | Threaded
Open this post in threaded view
|

[Haskell-begin] invoking GHCi programtically ?

Marco Túlio Gontijo e Silva
Em Sex, 2008-07-18 ?s 12:12 +0300, Krassimir Krustev escreveu:
> Is it possible to invoke GHCi from Haskell code?

I don't know if this is what you're looking for, but it could help:

http://www.cse.unsw.edu.au/~dons/code/typeof/

Greetings.

--
?Marco T?lio Gontijo e Silva
P?gina: http://marcotmarcot.googlepages.com/
Blog: http://marcotmarcot.blogspot.com/
Correio: [hidden email]
XMPP: [hidden email]
IRC: [hidden email]
Telefone: 25151920
Celular: 98116720
Endere?o:
 Rua Turfa, 639/701
 Prado 30410-370
 Belo Horizonte/MG Brasil