[Haskell-cafe] Intercept stdin in Haskell

Andrew Gibiansky andrew.gibiansky at gmail.com
Sun Jan 5 19:49:04 UTC 2014


I cannot modify the Haskell code.

I am working on IHaskell - it is effectively a Haskell interpreter. It
reads some code from the user, which may contain something like `getLine`.
However, the frontend to the interpreter is not a shell but is a GUI in the
web browser (IPython!). In order to do input, the interpreter sends a
message to the frontend via the network saying "give me input", the
frontend reads some input, and then sends things back.

In order to do this communication, I need to know when the getLine is
called so that I know I need to send the message to the frontend.

Ideas? The thing is, getLine needs to not actually read from any shell - it
will read from a pipe I create, and I simply need to know when to put stuff
into that pipe.

-- Andrew
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20140105/517c7a6a/attachment.html>


More information about the Haskell-Cafe mailing list