<div dir="ltr">On Sun, Feb 26, 2012 at 13:05, Alexander Batischev <span dir="ltr"><<a href="mailto:eual.jp@gmail.com">eual.jp@gmail.com</a>></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't be lost but instead consumed by subsequent reads (calls to<br>
getWord). That's how scanf() in C and 'cin >>' in C++ behave, and I'm<br>
quite surprised that I can'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's too easy to get yourself into odd issues where the tty line buffer and your program's notion of said buffer don't agree (if the terminal is in "icanon" 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's C'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>