haskell package layout: a proposal

Henning Thielemann schlepptop at henning-thielemann.de
Sat Dec 4 11:07:05 CET 2010

Mark Lentczner schrieb:
> Over on my blog, I've put up a proposal for changing the default layout of installed package pieces:
> 	http://mtnviewmark.wordpress.com/2010/12/02/haskell-package-layout/
> Thoughts?

About 1.
A package A with a specific version v must provide a specific API
independent of the compiler. If a package B imports A-v it cannot
additionally check what compiler was used to compile A (and B, too).
Thus documentation should really only depend on the package version. If
there is a feature, that is available only for a specific compiler, then
this must be moved into a separate package C. Package C can then be
compiled completely or not on a given compiler, but not in parts.

I have an additional problem with the current layout: You may use the
same compiler version on different operating systems and processors, say
Solaris/SPARC and Solaris/Intel. It's currently not possible to use them
in parallel, unless you use different Cabal directories. In Modula-3
they define Targets, where a target specifies Operating system,
Processor, Linker object format and compiler backend (GCC based or
othes). In short: The target contains every feature, that can make an
installed library different for the same compiler version.

I have still a problem with the current local Cabal directory structure.
Here everything is build below dist/build. I use Cabal in development
and have long dependency chains and different compilers installed. If a
basic package changes I have to recompile all dependent packages, but
ghc's 'make' feature of recompiling only dependent modules does not
help, because I have to recompile all modules, because dist/build cannot
hold the compiled files for two compiler versions.

More information about the Libraries mailing list