GHC as a library - getting output from GHCI

Simon Peyton-Jones simonpj at
Mon May 7 04:38:58 EDT 2007

| I am trying to use GHC as a library (see
| ). I want to get all the
| output from an interactive session and put in a GUI. This
| seemed to be a
| nice starting point.

If you want to collect *all* the output, that presumably includes the output of printing to 'stdout'? That is, if I type
        putStr "Hello"
I see the result.

If you manage to redirect stdout in this way, I think you will also see the value of your 'stmt', because what GHC does is to compile a little (print it) stmt and run it.

It's a while since I looked at the Interactive loop, but I think that's right.


More information about the Glasgow-haskell-users mailing list