[Haskell] Hierarchical module namespace extension not
sufficiently flexible
Iavor Diatchki
iavor.diatchki at gmail.com
Mon Dec 20 13:38:18 EST 2004
Hello,
> "Iavor S. Diatchki" <diatchki at cse.ogi.edu> writes:
> > One possible extension that might solve this problem is to allow
> > partial qualified names, i.e. a qualified name only specifies enough
> > of the _ending_ of the full qualified name to make it unambiguous.
>
> Whilst this is an attractive suggestion (and a variant has been
> implemented in nhc98 since it first adopted hierarchical namespaces),
> it does not solve Duncan's problem. An abbreviated qualifier is
> still dependent on using the module name from the /import/ statement,
> and thus all imports must be named explicitly, if you want to qualify
> their contents.
>
> The desire is to use an abbreviation of the original /exporting/
> module name, so that the exporting modules can be gathered together
> into a single container for import. Only one import statement is
> required, but it brings many qualifiers into scope.
> ...
This is a good point. When I was writing the above I was thinking that
perhaps we also add something like Java's .* imports, e.g:
import UI.Gtk.*
This is not very flexible as one has to import all modules. There is also the
question of what exaclt it means, e.g. does it import all modules in the current
directory, or also modules in sub-directories. Maybe that is not such
a good idea...
-Iavor
More information about the Libraries
mailing list