<div>I was hoping that hSetBuffering would turn off the line buffering for stdin, but it doesn&#39;t seem to work.</div>
<div>&nbsp;</div>
<div>----</div>
<div>module Main where<br>import System.IO</div>
<div>&nbsp;</div>
<div>main :: IO ()<br>main = do<br>&nbsp;&nbsp;&nbsp; hSetBuffering stdin NoBuffering<br>&nbsp;&nbsp;&nbsp; hSetBuffering stdout NoBuffering<br>&nbsp;&nbsp;&nbsp; <br>&nbsp;&nbsp;&nbsp; hPutChar stdout &#39;&gt;&#39;<br>&nbsp;&nbsp;&nbsp; c &lt;- hGetChar stdin<br>&nbsp;&nbsp;&nbsp; hPutChar stdout &#39;&lt;&#39;
<br>----</div>
<div>&nbsp;</div>
<div>This program should terminate immediately after the first character is typed into the terminal, but it waits until I type a newline.&nbsp; It also looks like it&#39;s using GNU readline (it handles the up &amp; down arrow keys.)
</div>
<div>&nbsp;</div>
<div>How do I turn this off and use&nbsp;raw&nbsp;character-based IO?&nbsp; I&#39;m using GHC6.6 on Win32 if that makes a difference.</div>
<div>&nbsp;</div>
<div>&nbsp; -- ryan</div>