WinHugs for GHCi, prompt feature

Neil Mitchell ndmitchell at gmail.com
Sun Feb 12 14:31:40 EST 2006


Hi,

I'm working on a Windows Haskell GUI, a lot like WinHugs (stealing a
lot of the code from WinHugs), which I want to make cross-compiler
happy - i.e. Hugs, GHCi and Yhc at least. [See
http://www-users.cs.york.ac.uk/~ndm/projects/winhaskell.php for a
really old screen shot]

The way I am operating with Hugs is by spawning a Hugs process as a
separate process, and redirecting the stdin, stdout and stderr to my
application. The hardest bit is figuring out when Hugs has run a
computation and finished, the way I am doing this currently is by
setting the prompt to escape characters, then when my program sees
these special escape characters it can determine that the computation
has finished and let the user enter the next one.

The problem with GHCi is that I haven't been able to set the prompt,
and therefore I can't detect when the computation is over, which makes
it quite hard to operate with. So what I would really like is any one
of:

1) Ability to set the prompt in GHCi
2) Some other mechanism to detect when the computation has finished
3) A way under Windows to detect when a console program is waiting on
user input (which I have been entirely unable to find, and may just
not exist)

WinHaskell is currently perfectly useable with Hugs, and maybe a month
or so away from release. I intend to start a darcs repo on tomorrow,
if anyone is interested in it.

Thanks

Neil


More information about the Glasgow-haskell-users mailing list