
[ thread moved from glasgow-haskell-users@haskell.org to libraries@haskell.org ]
"Simon Marlow"
writes: You must give the full module name in the header, eg.
module A.B.C where
This surprised me somewhat, and I must have missed any discussion/rationale. Could you elaborate/point me at the relevant information?
The discussion was on libraries@haskell.org (take a look at the archives), and the motivation was to make the smallest change possible to Haskell itself. With the current proposal, no changes are required to the Haskell report except for the 1-character change required to the lexical syntax of module names. I agree that it might be useful to be able to abbreviate module names by leaving out an initial prefix, so that entire subtrees can be moved without changing the source code. However, there are reasons why this approach is not so nice: as you point out, this introduces a dependency between the source code and the external environment, such that the meaning of a program depends on the directory layout and options to the compiler (currently the meaning depends on just the source to the collection of modules constituting the program), and also there is an inconsistency in that you would declare a module as 'C' but import it as 'A.B.C'. Cheers, Simon