I've done a fair bit of programming in haskell using GHCI however our next assignment requires us to use just GHC to compile and test our code.
Because of how ghci works compared to ghc you apparently need to use a main
function and the ghc looks for this function in your code.
My question is, if Haskell promotes type safety and no side-effects unless within an IO
action, why does the main part of any haskell program have to be an IO
action?
Forgive me if I'm not understanding something fundamental, I just couldn't find any resources which ultimately explains this.
3<Enter>
you are in essence writing, and then running, the programmain = print 3
. – Luc Danton