I've tried this:
main = do
hSetBuffering stdin NoBuffering
c <- getChar
but it waits until the enter is pressed, which is not what I want. I want to read the character immediately after user presses it.
I am using ghc v6.12.1 on Windows 7.
EDIT: workaround for me was moving from GHC to WinHugs, which supports this correctly.
:r
when you've edited your code, which I love. – Monteverdimain = do hSetBuffering stdin NoBuffering; interact $ map Data.Char.toUpper
? In my case it waits for a new line before any output appears. (Ubuntu, GHC 7.6.3.) – Portwine