
Gershom Bazerman wrote:
Beyond that, it would really help namespacing in general to appropriately extend the module system to allow multiple modules to be declared within a single file -- or, better yet, "submodules". I know that this introduces a few corner cases that need to be thought through -- what happens with overlapping declarations, for example. But I tend to think the path here is relatively straightforward and obvious, and the added expressive power should make namespacing issues much more tractable.
I agree, this would be a great first step forward. Nested modules would be the most helpful. But even just multiple modules per file would be an improvement, and that is Haskell 98 compliant. For past discussion about this idea, see the thread that begins here: http://www.haskell.org/pipermail/haskell-cafe/2008-August/046494.html There is also the issue of how GHC decides which files to open when searching for modules. One easy way to begin would be just to have the caveat that GHC will not find such modules unless it would otherwise look in the file based on the traditional GHC naming conventions. For various reasons including this one, I still think it is a good idea to allow the user to specify a manifest file to GHC instead of relying on GHC to walk the file system itself. See this GHC ticket: http://hackage.haskell.org/trac/ghc/ticket/2550 Thanks, Yitz