communication with ghci from haskell

Neil Mitchell ndmitchell at gmail.com
Mon Nov 20 10:25:09 EST 2006


Hi

You might want to take a look at GuiHaskell, which does something similar:
http://www-users.cs.york.ac.uk/~ndm/projects/guihaskell.php

> "runInteractiveProcess" function from the module System.Process. The main
> difficulty is that we don't see any possibility to determine when GHCi has
> finished its computation and is awaiting user input, that is to say, we
> don't know if there are any appropriate signals from GHCi that we could
> somehow handle in Haskell.

I added the :set prompt command to GHCi just for the purpose of this,
just do :set prompt "let's hope the user will never type this!" and
you can detect when the computation is over.

> we can neither display the output up to the current
> point of evaluation nor interrupt the calculation.

I was able to invoke a Ctrl+C on a GHCi Window using the Win32 API,
but so far haven't managed to replicate this in Haskell.

And a second question arises, what are you doing about threads +
Gtk2Hs + other stuff? Have you tested on Windows? This is the single
issue that means that GuiHaskell isn't available for release yet.

Thanks

Neil


More information about the Cvs-ghc mailing list