I am starting in Haskell and encounter this weird error message when trying to compile a .ghci file in Haskell. I have this very simple code for example:
main = do
putStrLn "Greetings! What is your name?"
inpStr <- getLine
putStrLn $ "Welcome to Haskell, " ++ inpStr ++ "!"
I saved the code in a file called basicio.hs
and tried to run
ghc basicio.hs
Instead of the String I get the following message
<interactive>:2:1: error:
Variable not in scope: runghc :: t0 -> b0 -> c
<interactive>:2:8: error: Variable not in scope: basicio
I am not sure what's wrong, the command ":load" works fine and find my file.