<div class="gmail_quote"><div>Thanks Steffen,</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div text="#000000" bgcolor="#ffffff">
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></div></blockquote><div><br></div><div>So this cycle of getting data from the connection and writing answer on the connection should happen concurrently with the ghci interaction ... so lets say that when the &quot;thread&quot; is forked that listens on socket behaves like an echo server ... as in, it reads data from the client till &quot;\n&quot; and echoes it back ... All this would happen without the intervention of the user using GHCI ... However, using GHCI, the user should be able to modify the code such that the server returns &quot;hello&quot; prepended to the input. ..</div>
<div><br></div><div>&gt; startMyServer -- at this point the the echo server gets spawned</div><div>&gt;                       -- echo server continues to run  </div><div>&gt; someFunction &quot;hello&quot; --- now onwards  hello gets prepended</div>
<div>&gt;                       --- echo server continues to run returning &quot;hello&quot; prepended</div><div>&gt; someFunction &quot;world&quot; --- now onwards &quot;helloworld&quot; get</div><div><br></div><div>I hope this is possible without having to modify ghci itself.</div>
<div><br></div><div>Regards,</div><div>Kashyap</div></div>