
Mon, 12 Mar 2001 14:29:59 +0100 (MET), Johannes Waldmann
Do we need two types of `imports': `import Foo.Bar.M' imports a module, while `import Foo.Bar.*' does not actually import a module, but rather adds an element to the search path.
I would prefer to import module names like other names, i.e. import Foo.Bar -- It can make some module names visible. import M -- Imports Foo.Bar.M, assuming it exists. If more than -- one module called M is visible, it's an ambiguity -- error as usual. import Foo.Bar as F import F.M -- Same as above. The only special thing about module names is that their prefixes are automatically imported qualified, i.e to refer to Foo.Bar.M.f you don't have to import each of Foo, Bar and M separately, but just import fully M using its qualified name. This works for other names in ghci. Such Foo.Bar module is not defined explicitly, but results from having a subdirectory in import directories. Contents of all Foo.Bar directories from all import directory roots are merged to form such pseudo-module which contains nothing but modules. In a future version of Haskell, when module export list will specify the interface and not only names, it will be possible to export modules from other explicit modules. There will be no distinction between modules which contain only modules and modules which contain everything else. -- __("< Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/ \__/ ^^ SYGNATURA ZASTÊPCZA QRCZAK