
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. Regards -- Adrian Hey

Adrian Hey
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
Well (trying to answer my own question), I guess the reason for this change is probably Cabal related, so perhaps someone here can explain.
I think it is something to do with the regular expression describing legal Cabal package names. A package name basically has three components: name, version number, and tag. The middle part, the version number, may contain dots, but I imagine the outer parts, the name and tag, may not?
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).
The main design criterion for the hierarchical scheme was to classify by functionality, rather than by arbitrary names. Joanna Random Programmer should be able to quickly descend the tree hierarchy to find a module suiting her specific needs, rather than having to look through a 1000-long flat list of package names, which may or may not adequately describe their contents.
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.
Yes, perhaps. At least, I can't think of a good argument not to - it is only the practical difficulty of parsing the full packagename with version numbers that prevents it, and there may be a way to fix that. Regards, Malcolm

On Thursday 10 Mar 2005 1:47 pm, Malcolm Wallace wrote:
I think it is something to do with the regular expression describing legal Cabal package names. A package name basically has three components: name, version number, and tag. The middle part, the version number, may contain dots, but I imagine the outer parts, the name and tag, may not?
Thanks. What's a "tag", BTW? (Cabal docs don't mention it AFAICS, but maybe I've missed something). Regards -- Adrian Hey
participants (2)
-
Adrian Hey
-
Malcolm Wallace