[Haskell-cafe] Character I/O

2009-03-31 Thread Andrew Coppin
I ran the following program: module Main where main = do putStrLn Key c - getChar print c main Unfortunately, it doesn't do what I was hoping. Specifically, it only returns any data when I hit [return]. It also seems to be giving me a command history somehow. Special keys (e.g.,

Re: [Haskell-cafe] Character I/O

2009-03-31 Thread Andrew Coppin
Edward Kmett wrote: You want to use: main = do hSetBuffering stdin NoBuffering; c - getChar Already tried that. It appears to make no difference. ___ Haskell-Cafe mailing list Haskell-Cafe@haskell.org

Re: [Haskell-cafe] Character I/O

2009-03-31 Thread Thomas DuBuisson
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

Re: [Haskell-cafe] Character I/O

2009-03-31 Thread Judah Jacobson
On Tue, Mar 31, 2009 at 12:53 PM, Andrew Coppin andrewcop...@btinternet.com wrote: Edward Kmett wrote: You want to use: main = do hSetBuffering stdin NoBuffering; c - getChar Already tried that. It appears to make no difference. Sounds like you're on Windows, so it's probably this bug:

Re: [Haskell-cafe] Character I/O

2009-03-31 Thread Andrew Coppin
Judah Jacobson wrote: Sounds like you're on Windows, so it's probably this bug: http://hackage.haskell.org/trac/ghc/ticket/2189 I am on Windows. It looks like my programs are running editline or something to give a command history. Ordinarily that would actually be quite useful, but for

Re: [Haskell-cafe] Character I/O

2009-03-31 Thread Judah Jacobson
On Tue, Mar 31, 2009 at 2:11 PM, Andrew Coppin andrewcop...@btinternet.com wrote: Judah Jacobson wrote: Sounds like you're on Windows, so it's probably this bug: http://hackage.haskell.org/trac/ghc/ticket/2189 I am on Windows. It looks like my programs are running editline or something to