| OK, if you want to pick nits, let me qualify my use of
| the word 'program' - a set of Haskell98 modules containing
| the module 'Main'.
Yes, that is the definition that appears in the Haskell 98
report also.
| Hugs98 accepts Main.main as having a signature other than
| (IO t), which is wrong wrt Haskell98 - if you don't want
| to check for that for philosophical (or whatever) reasons,
| could you at least document it?
I have searched through the Haskell 98 report quite carefully,
and cannot find anything that says that accepting a Main.main
with signature other than (IO t) is wrong.
According to the report, it is, by implication, impossible to
have a Haskell 98 program that contains such a module. For this
reason, runhugs will reject such a program. Enforcing the
restriction in Hugs, however, would needlessly break existing
code, to comply with a restriction that the Haskell 98 report
doesn't make. Another (and more direct) implication of the
report is that a Haskell program must contain a definition of
Main.main. But you surely wouldn't expect Hugs to start
complaining about this if a user fires up Hugs with just the
prelude in place (and hence no Main.main) and starts evaluating
expressions? My point is that the collections of modules that
might be loaded into a Hugs session are not required to form
a valid Haskell 98 program (in the sense of the definition),
and nobody ever said they should be.
You may think I'm picking nits, but I'm not. People on these
mailing lists often report discrepancies between the report and
the implementation. If we were to enforce the restriction that
you describe, then I think we would be moving *away* from what
the Haskell report specifies, and opening ourselves to further
reports of discrepancies. I'm simply acting on the interpretation
provided by my own language lawyer. If you think exclusively in
terms of compilers (and much of the Haskell report is written from
that perspective), then your interpretation of the report may differ
from mine.
All the best,
Mark