[Haskell-cafe] Character I/O

Thomas DuBuisson thomas.dubuisson at gmail.com
Tue Mar 31 16:29:04 EDT 2009

Andrew Coppin wrote:
> Edward Kmett wrote:
>> You want to use:
>>  > main = do hSetBuffering stdin NoBuffering; c <- getChar
> Already tried that. It appears to make no difference.

Really?  It fixes your first issue for me (data appears immediately
when the key is pressed) but obviously does nothing to give you the
special keys (ctrl, esc, etc) - not sure of a platform independent way
to get that, but there's bound to be one.

Are you on Windows?  Did you try inserting a 'flush'?

More information about the Haskell-Cafe mailing list