<div dir="ltr">On Sun, Feb 26, 2012 at 13:05, Alexander Batischev <span dir="ltr">&lt;<a href="mailto:eual.jp@gmail.com">eual.jp@gmail.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div id=":16p">The main idea behind that is if user entered more values then required,<br>
they won&#39;t be lost but instead consumed by subsequent reads (calls to<br>
getWord). That&#39;s how scanf() in C and &#39;cin &gt;&gt;&#39; in C++ behave, and I&#39;m<br>
quite surprised that I can&#39;t do that in Haskell.</div></blockquote></div><br>Almost every time I have used non-line-oriented I/O in a basic terminal I/O context, I have had to go back and rewrite it to be line-oriented.  It&#39;s too easy to get yourself into odd issues where the tty line buffer and your program&#39;s notion of said buffer don&#39;t agree (if the terminal is in &quot;icanon&quot; mode) or discover you need backspace to work (if not).<br>
<br>If you absolutely insist on shooting yourself in the foot this way in Haskell, it can be done; but there is no reason Haskell should make it *easy* to do so.  That&#39;s C&#39;s superpower.  :)<br><br>-- <br>brandon s allbery                                      <a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a><br>
wandering unix systems administrator (available)     (412) 475-9364 vm/sms<br><br>
</div>