[Haskell-cafe] What's in a name?

Sean Leather leather at cs.uu.nl
Fri Aug 15 17:26:02 EDT 2008

> Andrew Coppin wrote:
> > Now both packages can be installed at once, but when I say "import
> > Data.Hashtable", GHC has no way to know which one I mean. That doesn't
> sound
> > too clever to me...

I agree, Andrew. The hierarchical module approach depends on a global
resource for allocating names (or at least everybody agreeing on the scheme
of choice). By trying to make all module names equal descriptive categories,
it doesn't scale well. There are too many possibilities for overlap or
different categorizations for the same thing.

Felipe Lessa wrote:

> GHC can hide packages or, put it another way, can show only the
>  packages you want. That's what Cabal does when compiling. For example,
> try to remove some package from the dependencies and watch GHC
> complain.

That doesn't work if you want to use two packages that have modules sharing
the same hierarchical name, and this is a definite possibility given my
statements above. Of course, having the ability to import modules from
specific packages [1] would fix this, but only as long as the package names
are also unique.

Personally, I like the Java package naming scheme recommendation. It scales
better, because each package name uses the organization or URI to uniquely
identify a subset.


[1] http://thread.gmane.org/gmane.comp.lang.haskell.cvs.ghc/29319 - But
notice the not really intended for general use bit.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20080815/5d7db449/attachment.htm

More information about the Haskell-Cafe mailing list