Legal package names

Simon Marlow simonmar at microsoft.com
Thu Mar 10 08:22:27 EST 2005


On 10 March 2005 12:51, Adrian Hey wrote:

> 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.

Sorry for not getting back to you sooner on this one.

I agree that package names should be allowed to include '.'.
Unfortunately for no good reason they don't, and it's too late for 6.4
:-(

There are some good reasons why package names are separate from the
module hierarchy.  The archives have lots of old discussion on this
topic, but IIRC it can be boiled down to these points:

  - there can be multiple packages with the same modules (eg.
    multiple versions of a package)

  - we don't want administrativia (eg. versions) to be part of
    the module hierarchy: the hierarchy is intended to organise by
    *functionality* only.

Cheers,
	Simon


More information about the Libraries mailing list