Haskell: I/O Not in Order?
Hi. I'm learning Haskell from an on-line tutorial, and trying to figure out how I/O works. I'm a bit confused with this example:
Code:
import Control.Monad However, what actually happens when I run it is it firsts ask me for a line, then outputs "Next line: ", then outputs the uppercase line: Code:
$ ghc forever-example.hs -o forever-example I'm running: - Linux version 2.6.34-gentoo-r12 (64-bit) - GNU bash, version 4.1.9(2)-release (x86_64-pc-linux-gnu) - Glasgow Haskell Compiler, Version 6.12.3, for Haskell 98, stage 2 booted by GHC version 6.12.3 |
This would be better answered form the makers of ghc.
|
I don't have Haskell on my system and know nothing about it, and you didn't give a link to your tutorial, but just looking around, I'd suggest you change
Code:
putStr Code:
putStrLn So the next question is: how do you fix it so that the prompt and the keyed input appear on the same line? Dunno. Don't know Haskell. Sorry. |
All times are GMT -5. The time now is 05:45 PM. |