multiple cabal files in one directory?

Henning Thielemann lemming at henning-thielemann.de
Wed Jan 12 12:59:34 CET 2011


On Wed, 12 Jan 2011, Peter Simons wrote:

> > So you could in principle call it description.cabal consistently in
> > all your packages.
>
> Is it also possible to use a package-specific name for Setup.hs? If I'd
> be writing a package called "foo", could I use the name "foo.cabal" and
> "foo.setup" to designate my build instructions? I'd also be happy to
> call the "Setup.hs" file "Setup-foo.hs" or "Foo-setup.hs" or whatever,
> as long as there's a package-specific component in the name that matches
> the one I used for the Cabal file.
>
> If that were the case, then multiple packages could be stored in one
> directory, and a build call like
>
>  cabal configure --package=foo
>
> would be unambiguous.

I think this leads to nothing - you would also need directories like 
dist-foo and maybe more in the future. The one-directory-to-one-package 
relation makes things easy and that's somehow what directories are for. 
The other way round makes more sense to me: Give all package Cabal files 
the same name (main.cabal?), since the package name is already given by 
the directory name. Maybe in the future someone wants a Cabal include 
mechanism that allows to write one Cabal file per executable and to put 
them together according to include statements in main.cabal.

The discussion and the personal preferences are certainly similar to 
whether to put many modules into one file, or whether to define 
identifiers for unqualified import and export many modules by one main 
module.

My question is: What is really the benefit of having multiple packages in 
one directory? kahl at cas.mcmaster.ca has commented on this question, but 
his use case didn't convince me. Building many packages at once, an 
inter-package Make so to speak, would be nice, but this could be separate 
from the technique of building one package.



More information about the Libraries mailing list