Legal package names
Malcolm Wallace
Malcolm.Wallace at cs.york.ac.uk
Thu Mar 10 08:47:32 EST 2005
Adrian Hey <ahey at iee.org> writes:
> > 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
More information about the Libraries
mailing list