WinHugs for GHCi, prompt feature

Claus Reinke claus.reinke at
Sun Feb 12 17:04:02 EST 2006


not a good week for such questions, as the Simons have gone on
holiday, but here are some pointers.

- check out the emacs mode for haskell, which does a similar thing

- if you are serious about this (more than just a few buttons for 
    the ghci/hugs commands;-), you might want to go for a tighter 
    integration with the interactive Haskell implementations. 

    of course, that should still be based on some interface, just
    something more direct and more flexible than feeding the
    command-line. there is no common standard (yet; another
    item for haskell'?-), but

    Hugs has (or had?) the Hugs Server API

    GHC has the GHC API (which is also used for the Visual Studio plugin)


----- Original Message ----- 
From: "Neil Mitchell" <ndmitchell at>
To: <glasgow-haskell-users at>
Sent: Sunday, February 12, 2006 7:31 PM
Subject: WinHugs for GHCi, prompt feature


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 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

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.


Glasgow-haskell-users mailing list
Glasgow-haskell-users at

More information about the Glasgow-haskell-users mailing list