I recently started to learn Haskell. I have this code
module Main where import IO main = do hSetBuffering stdin LineBuffering putStrLn "Please enter your name: " name <- getLine putStrLn ("Hello, " ++ name ++ ", how are you?")
I use the GHC compiler with the notepad ++ editor. The problem is that the interaction is as follows:
The process has begun →>
Vlad
Please enter your name:
Hello Vlad, how are you? & L; <<The process is completed.
As you can see, the output is written only after entering something. This was a bit unexpected, because I was sure that the program would first ask for my name, then I would go into it, and then he would say hello. Well, what exactly happens if I run exe manually, but I will not start it using Notepad ++ and use its console shell ...
How can I make notepad ++ display the output when it should, and not all this before the program terminates? Is it possible?
Ivlad source share