I am using windows XP, and both in cygwin and cmd, it first pauses to get the input, and then displays the prompt and the hello message in the same line. <br><br><br>c:\haskell>runghc Test.hs<br>test<br>Please Enter Your Name: Hello test<br>
<br>Ali<br><div class="gmail_quote">On Thu, Mar 4, 2010 at 1:13 PM, Deniz Dogan <span dir="ltr"><<a href="mailto:deniz.a.m.dogan@gmail.com">deniz.a.m.dogan@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
2010/3/4 Ali Razavi <<a href="mailto:ali.razavi@gmail.com">ali.razavi@gmail.com</a>>:<br>
<div><div></div><div class="h5">> Why doesn't this work the way it's supposed to, or the way it's intuitively<br>
> apparent from the code, that is, showing the prompt first, getting the line<br>
> next, and printing the result finally?<br>
><br>
> main = do<br>
> putStr "Please Enter Your Name: "<br>
> name <- getLine<br>
> putStrLn ("Hello " ++ name)<br>
><br>
><br>
> changing putStr with putStrLn rectifies it to the expected behavior, but I<br>
> wonder why this version misbehaves. FWIW, I use ghc in cygwin.<br>
><br>
> Ali<br>
><br>
<br>
</div></div>FWIW using GHCi in standard Windows Vista, this works like it should.<br>
<br>
--<br>
<font color="#888888">Deniz Dogan<br>
</font></blockquote></div><br>