libraries and executables in cabal

Hi, i'm working on a project made of - lots of modules - one excutable importing these modules - another excutable importing these same modules I don't especially want to expose those modules as libraries, especially on hackage, since they are meaningless without the executables. But, if I declare two executables in my .cabal file, cabal will compile all those modules two times each time I want to compile the executables. Is there a way to tell cabal that those modules should be considered part of a "private" library ? Paul

Paul Brauner schrieb:
Hi,
i'm working on a project made of
- lots of modules - one excutable importing these modules - another excutable importing these same modules
I don't especially want to expose those modules as libraries, especially on hackage, since they are meaningless without the executables.
But, if I declare two executables in my .cabal file, cabal will compile all those modules two times each time I want to compile the executables.
Is there a way to tell cabal that those modules should be considered part of a "private" library ?
You can at least add Other-Modules to the Executables, but the problem of recompilation remains. Otherwise you may create a separate library package that contains all the code for the executables but only exposes the two main functions.

On Thu, 2010-03-25 at 14:52 +0100, Paul Brauner wrote:
Hi,
i'm working on a project made of
- lots of modules - one excutable importing these modules - another excutable importing these same modules
I don't especially want to expose those modules as libraries, especially on hackage, since they are meaningless without the executables.
But, if I declare two executables in my .cabal file, cabal will compile all those modules two times each time I want to compile the executables.
Is there a way to tell cabal that those modules should be considered part of a "private" library ?
Not yet. We recently added the ability for executables within a package to depend on a public library [1]. What we are missing is the ability to specify "convenience" or "private" libraries [2]. [1]: http://hackage.haskell.org/trac/hackage/ticket/89 [2]: http://hackage.haskell.org/trac/hackage/ticket/276 Duncan
participants (3)
-
Duncan Coutts
-
Henning Thielemann
-
Paul Brauner