Better error message when missing main
I was thinking we could have a better error message for Main
modules without a main
functions
We currently have:
(tmp) (^_^♪) touch B.hs
(tmp) (^_^♪) runhaskell B.hs
B.hs:0:53: error: [GHC-88464]
Variable not in scope: main :: IO a0
Suggested fix: Perhaps use ‘min’ (imported from Prelude)
It might be worth having an error message that highlights main
being a special name for the entrypoint of the program (expected in Main
module), with a special error code (that can further explain modules without module Name where
are Main
by default), instead of a generic "var out of scope error" which isn't clear in this context and even suggests using another prelude function min
instead of main
which is nonsensical.