18 Aug
2006
18 Aug
'06
12:09 p.m.
Hi all, How to read one char from stdin and return immediately? I mean there is no need to wait the user input a return. For example: Print "y/n: " Users input y, return immediately, no return need. I have tried code as below, but it didn't work for me. import IO main = do hSetBuffering stdout NoBuffering putStr "Y/N: " c <- getChar putStr ("Your input is " ++ show c++".\n") Thanks very much. Best regards, Haihua Lin