<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=ISO-8859-1"
 http-equiv="Content-Type">
  <title></title>
</head>
<body text="#000000" bgcolor="#ffffff">
On 02/04/2011 12:36 PM, C K Kashyap wrote:
<blockquote
 cite="mid:AANLkTintbzM_qEmFH=ijc5NudTTuk=eHqLYX1SAcXZ__@mail.gmail.com"
 type="cite">Hi,
  <div>I am looking for a way to extend GHCI such that I can do
something like this</div>
  <div><br>
  </div>
  <div>
  <div>$ ghci</div>
  <div>GHCi, version 6.12.3: <a moz-do-not-send="true"
 href="http://www.haskell.org/ghc/">http://www.haskell.org/ghc/</a> &nbsp;:?
for help</div>
  <div>Loading package ghc-prim ... linking ... done.</div>
  <div>Loading package integer-gmp ... linking ... done.</div>
  <div>Loading package base ... linking ... done.</div>
  <div>Loading package ffi-1.0 ... linking ... done.</div>
  <div>Prelude&gt; startMyFunction</div>
  </div>
  <div>Prelude&gt;&nbsp;</div>
  <div><br>
  </div>
  <div>startMyFunction will do a forkIO and listen on a network port
for interaction with a remote process and will drop back to GHCI prompt
where I can invoke haskell functions that'll control the way the
interaction with the remote process occurs. Can this be done?</div>
</blockquote>
I am not sure that I understand you correctly, but ghci simulates the
IO monad, so what about:<br>
<br>
Prelude&gt; :l MyModule.hs<br>
*MyModule&gt; conn &lt;- waitForAndAcceptConnection<br>
*MyModule&gt; someData &lt;- getSomeData conn<br>
*MyModule&gt; sendSomeAnswer conn $ processSomeData someData<br>
...<br>
<br>
-- Steffen<br>
<br>
<blockquote
 cite="mid:AANLkTintbzM_qEmFH=ijc5NudTTuk=eHqLYX1SAcXZ__@mail.gmail.com"
 type="cite">
  <div><br>
  </div>
  <div>Regards,</div>
  <div>Kashyap</div>
  <div><br>
  </div>
  <pre wrap="">
<fieldset class="mimeAttachmentHeader"></fieldset>
_______________________________________________
Haskell-Cafe mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Haskell-Cafe@haskell.org">Haskell-Cafe@haskell.org</a>
<a class="moz-txt-link-freetext" href="http://www.haskell.org/mailman/listinfo/haskell-cafe">http://www.haskell.org/mailman/listinfo/haskell-cafe</a>
  </pre>
</blockquote>
<br>
</body>
</html>