[Haskell-beginners] GHCI in my app...

Brandon Allbery allbery.b at gmail.com
Sun Jul 10 21:48:13 CEST 2011


On Sun, Jul 10, 2011 at 12:43, Sean Charles <sean at objitsu.com> > am
opening a socket, getting input, parsing it and executing commands....
> what I would really like to be able to do is to *use* the already pretty
> slick ghci interface instead...
> ...so, is there a way to create an instance of it and attach it to the
> socket?

Sort of.  See http://www.haskell.org/haskellwiki/GHC/As_a_library; in
particular, http://www.haskell.org/ghc/docs/latest/html/libraries/ghc/InteractiveEval.html
is probably of interest.  I don't know how much of GHCi you'd have to
reimplement, though — the library is there, and does everything GHCi
does, but I don't think it includes the REPL per se.  Looks to me like
you'd need to implement your own parser for ":"-commands and "import".

-- 
brandon s allbery                                      allbery.b at gmail.com
wandering unix systems administrator (available)     (412) 475-9364 vm/sms



More information about the Beginners mailing list