
14 Oct
2012
14 Oct
'12
noon
On Sun, Oct 14, 2012 at 11:31:58AM -0400, Brandon Allbery wrote:
On Sun, Oct 14, 2012 at 11:14 AM, Motiejus Jakštys
wrote: The behaviour is fine: right after entering a character, I get echo back.
However, when started with runhaskell (or compiled ./getchar):
motiejus@precise> runhaskell getchar.hs la<CR> Entered: l Entered: a Entered:
http://www.haskell.org/ghc/docs/latest/html/users_guide/ghci-faq.htmlscroll to the bottom.
Thanks. Not exactly like in the FAQ, but it lead me to the right direction. In my case stdin in ghci is not buffered, whereas in ghc it is line buffered. Turning stdin buffering off before getChar (hSetBuffering stdin NoBuffering) made it work. Regards, Motiejus