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