<div class="gmail_quote">On Fri, Aug 21, 2009 at 6:53 PM, David Menendez <span dir="ltr">&lt;<a href="mailto:dave@zednenem.com">dave@zednenem.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">You would still need to determine whether you&#39;ve reached EOF or not,</div>
which forces the input to be determined up to the first line-break or<br>
EOF.</blockquote><div><br></div><div>Good point!  I actually had it on my TODO list, but that settles it then :)</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"> run :: MyIO () -&gt; Behavior</div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
&gt; run m = runCont m (\_ _ -&gt; [])<br>
&gt; foo = do<br>
&gt;    putLine &quot;Enter name: &quot;<br>
&gt;    name &lt;- getLine<br>
&gt;    putLine (&quot;Welcome &quot; ++ name ++ &quot;\n&quot;)<br>
&gt; main = interact (run foo . lines)<br>
&gt; You get the &quot;Welcome&quot; before the name again.<br>
&gt; To be honest I don&#39;t fully understand why this is a horrible hack.<br>
<br>
</div>It isn&#39;t. Some people dislike seq because it lets you force strictness<br>
in cases where pattern matching cannot (like function arguments), but<br>
hardly anyone objects to pattern matching.</blockquote><div><br></div><div>Ah so it&#39;s subjective. Okay, it&#39;s sometimes hard for a newbie to find the &quot;truth&quot; when several experts contradict eachother. Because often when people claim something here, they have very good reasons for it, reasons that are not obvious at all to your average newbie!</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">&gt; Too bad that something extremely simple like console text IO doesn&#39;t seem to<br>
&gt; be a good start for introducing FRP, or maybe seen from another angle (using<br>
&gt; Reactive) it might still be, dono<br>
<br>
</div>Are you writing an introduction to using FRP, or an introduction to<br>
implementing FRP? Every Haskell FRP implementation I&#39;m aware of uses<br>
the IO monad internally.</blockquote><div><br></div><div>Both really. I think to start with I just want to start a blog to write down random pieces (like this interesting conversation), and then see where this will lead me. I&#39;m mainly interested in doing a survey of existing systems, comparing pros/cons with clear examples (at least for myself ;), and also making minimal implementations so I understand the essence of the various techniques.</div>
<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">If you want to be able to run in an entirely pure manner, you might<br>
investigate IOSpec.<br>
<br>
&lt;<a href="http://hackage.haskell.org/package/IOSpec" target="_blank">http://hackage.haskell.org/package/IOSpec</a>&gt;<br>
<font color="#888888"></font></blockquote><div><br></div><div>Ah I didn&#39;t know that one yet, thanks</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<font class="Apple-style-span" color="#888888"><br></font></blockquote></div>