Packages within a package

Henning Thielemann lemming at henning-thielemann.de
Wed Oct 24 08:34:14 EDT 2007


On Wed, 24 Oct 2007, Duncan Coutts wrote:

> On Tue, 2007-10-23 at 22:21 +0200, Henning Thielemann wrote:
>
> > > Does Cabal not support things like packages within a package simply
> > > because Haskell libraries currently are not complex enough to require
> > > such a feature, or is there a guiding design principle with which
> > > these features are incompatible?
> >
> > It was requested several times but it seems not to be designed and
> > implemented so easily.
>
> The design choice is that the Cabal package is the unit of distribution.
> Of course what one sees as a system may well consist of multiple
> interdependent packages.
>
> The direction I think we're moving in is to try to improve our tools to
> make it easier for developers to work with systems that consist of
> multiple packages. However from the distribution and installation point
> of view, nothing needs to change, the package remains the unit of
> distribution.
>
> As far as I can see that covers all the cases where we might want
> "distributions", "shipments" or "sub-packages". Of course if anyone has
> any examples where they think our model might not cover things we should
> bring them up and consider them.

If it becomes much easier to handle multiple packages this might work.
  - Recompiling multiple packages must be simplified, because I use Cabal
in the development phase. If one "sub-package" changes it must be simple
to recompile the package set and to import modified "sub-packages" without
their installation. (Because installation might overwrite valid code with
buggy code.) This includes finding the right order of package compilation
according to the package dependencies. (I have even some code using FGL
for this task, if someone is interested.)
  - It must be simple to distribute and to download multiple packages that
belong together. It would be nice if one could maintain several packages
which share the same 'src' directory in one darcs repository, which is of
course duplicated on distribution. Say


Foo.cabal
   Hs-Source-Dirs: src
   Exposed-Modules: Data.Structure.Foo

Bar.cabal
   Hs-Source-Dirs: src
   Exposed-Modules: Data.Structure.Bar

FooDemo.cabal
   Hs-Source-Dirs: demo
   Main-Is: FooDemo.hs

BarDemo.cabal
   Hs-Source-Dirs: demo
   Main-Is: BarDemo.hs

src/Data/Structure/Foo.hs
src/Data/Structure/Bar.hs
demo/FooDemo.hs
demo/BarDemo.hs


More information about the Libraries mailing list