Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Haskell beginner help

Name: Anonymous 2009-02-25 16:03

I'm learning haskell and I stumbled upon a problem. Here's the code:

module Main
  where

main = do putStr "Input your name: "
          s <- getLine
          putStrLn s
          main


But 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: bar


When running the code in the interpreter, everything's alright. What's the problem?

Name: Anonymous 2009-02-25 20:24

>>13
>>=12
I see what you did there.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List