[Haskell] Re: Proposal: Relative Module Imports

Samuel Bronson naesten at gmail.com
Tue May 3 18:34:57 EDT 2005


On 5/3/05, S. Alexander Jacobson <alex <at> alexjacobson.com> wrote:
> Problem: We need a way to simplify module imports.
>
> Problem details:
>
> * Hierarchical module names are getting really long (including a
> functional area, a package name, and a module name).
>
> * People typically import multiple modules from areas close to each
> other in the hierarchical module namespace (especially in the case of
> intra-package imports).
>
> * Long module names are required even for non-exposed modules because
> a program may contain only one module with a given name (regardless of
> its visibility).
>
> Idea: Allow module relative imports in a manner that does not break
> any existing code.

This would be really nice, but I'm not sure I like the way you propose
to do it. Those bare dots don't look very nice to me, and I really
don't like the idea of having to count them... I'm not even sure I
like the idea of imports relative to the current module.

I almost want "import Text.HaXML.XML.{Types,Escape,Pretty}", but not
quite. And that would not be nice for qualified imports, anyway.

Maybe something like

from Text.HaXML.XML import (Types, Escape, Pretty)

would be nice.

-- Sam



More information about the Haskell mailing list