I have a followup question to Lennart's motivated by the same
IOHCC entry.
The Haskell report states that in an abbreviated module, the
header is assumed to be
module Main where
which makes all the identifiers exportable (and so the monomorphism
restriction could bite the unwary). I tend to think that the header
should be the simpler
module Main(main) where
so that only main is exported. It seems to me that the only value of
having the abbreviated form is for small, single-module programs, so
main is the only thing that needs to be exported. In a multi-module
program it seems to me to be bad practice not to be explicit about all
module headers. At least in the case when Main defines stuff used by
other modules this proposal will require the header to be explicit.
John.
PS. I don't know how others out there feel about the Obfuscated Haskell
competition that Lennart is running, but I am now convinced it's a
great idea. It is exactly these programs which test the corners of
the language definition. Perhaps some of them should go into Ian
Holyer's validation suite! Just in preparing my entry I hit a bug
in glhc (with regard to defaults), and the program's failure under
hbc provoked Lennart's question.