$ runhaskell MyFile.hs
Alternatively, runghc
(they’re the same thing). ghci MyFile.hs
will also start an interactive REPL session with MyFile.hs
loaded, but if you want to run a main program then runhaskell
is the way to go.
It’s probably a good idea to get into the habit of testing parts of your program as isolated units in GHCi rather than running the whole thing each time, but obviously for shorter scripts it’s simplest and easiest just to run the entire thing.