Name: Anonymous 2009-02-25 16:03
I'm learning haskell and I stumbled upon a problem. Here's the code:
But after compiling and running, the prompt string doesn't get printed until I input stuff, like this:
When running the code in the interpreter, everything's alright. What's the problem?
module Main
where
main = do putStr "Input your name: "
s <- getLine
putStrLn s
mainBut after compiling and running, the prompt string doesn't get printed until I input stuff, like this:
foo
Input your name: foo
bar
Input your name: barWhen running the code in the interpreter, everything's alright. What's the problem?