Legal package names

Adrian Hey ahey at
Thu Mar 10 07:51:17 EST 2005

Moving from ghc-users..

On Monday 07 Mar 2005 3:44 pm, Adrian Hey wrote:
> Hello,
> I've been trying 6.4 on one of my libraries and it seems it doesn't
> like my package names. I give my packages the same name as their
> place in the module hierarchy.
> e.g.
> name: Data.COrdering
> Is there any reason why this shouldn't be allowed? It seems
> so much more convenient this may, at least for packages
> the have just one root module.

Well (trying to answer my own question), I guess the reason for
this change is probably Cabal related, so perhaps someone here
can explain.

Thinking about this, there doesn't seem to be any good reason for
separate package names at all. It just means we have two name
space problems instead of one (having to avoid package name and
hierarchical module name clashes).

Why not just use the root in the hierarchical module name space
as the package name? (or use the package name as the root
in the hierarchical module name space).

So the OpenGL package should be called "Graphics.Rendering.OpenGL",
or drop the "Graphics.Rendering" prefix, keep OpenGL as the package
name and name its modules accordingly (OpenGL.GL, OpenGL.GLU etc..). 
(I think it would be rather nice to be able to tell what package
a module came from by looking at it's name.)

But I definitely think the most obviously appropriate (I.E. consistent
with hierarchical module scheme) package names like "Data.COrdering"
should at least be legal.

Adrian Hey

More information about the Libraries mailing list