Wrong IO actions order using putStr and getLine
This is because ghci disables buffering, while a program compiled with ghc has line buffering by default. You can see this by running this: import System.IO main = print =<< hGetBuffering stdout In ghci you see NoBuffering while with runghc you get LineBuffering. Since the newline character doesn’t print until after the user input, the … Read more