When I want to put some text before reading an input in Haskell, I tried writing it like this:
putStr "enter value: "
var <- getLine
However the output requires the user input before it displays the text:
[input]
enter value:
When I use putStrLn
instead of putStr
, it displays as it should:
enter value:
[input]
Why do these two statements function differently? Is it the addition of the newline?