<div class="gmail_quote">On Fri, Aug 21, 2009 at 6:53 PM, David Menendez <span dir="ltr"><<a href="mailto:dave@zednenem.com">dave@zednenem.com</a>></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'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 () -> Behavior</div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">
> run m = runCont m (\_ _ -> [])<br>
> foo = do<br>
> putLine "Enter name: "<br>
> name <- getLine<br>
> putLine ("Welcome " ++ name ++ "\n")<br>
> main = interact (run foo . lines)<br>
> You get the "Welcome" before the name again.<br>
> To be honest I don't fully understand why this is a horrible hack.<br>
<br>
</div>It isn'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's subjective. Okay, it's sometimes hard for a newbie to find the "truth" 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">> Too bad that something extremely simple like console text IO doesn't seem to<br>
> be a good start for introducing FRP, or maybe seen from another angle (using<br>
> 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'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'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>
<<a href="http://hackage.haskell.org/package/IOSpec" target="_blank">http://hackage.haskell.org/package/IOSpec</a>><br>
<font color="#888888"></font></blockquote><div><br></div><div>Ah I didn'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>