I have the following code:
main = do
putStr "Test input : "
content <- getLine
When I run it (with
runhaskell) or compile it (ghc 6.10.4) the result is like this:
Test input : asd
Test input : asd being printed after
In the code sample on http://learnyouahaskell.com/, which uses
getLine's presented output is different than mine. When I use
putStrLn the program works as expected (print, then prompt, and print).
Is it a bug in
ghc, or it is the way that it should work?