[Haskell-cafe] Re: cabal, haddock, hscolour

Duncan Coutts duncan.coutts at googlemail.com
Wed Aug 18 09:08:32 EDT 2010

On 18 August 2010 12:55, Johannes Waldmann <waldmann at imn.htwk-leipzig.de> wrote:
> Duncan Coutts <duncan.coutts <at> googlemail.com> writes:
>> Your .cabal file probably does not list the "other-modules" as it
>> should, so Cabal does not know that the other modules exist.
> Ah.
> Strange though that it seems to be able to do lots
> of reasonable things (build the executable, build all the API docs)
> without this "other-modules" section.

Right. It is required but not enforced. If you forget with executables
then usually nothing horrible happens. If you forget with libraries
then you end up with a broken library. Enforcing it properly is on the
TODO list.

> I figure it's a cabal design choice, but I don't see the reason for it.

In general it is impossible to use dependency chasing to automatically
discover all the modules/files required by a lib/exe because of things
like conditional compilation. You can find out what is needed for the
current configuration for the current machine, but that does not help
with preparing source distributions where e.g. you might have
different modules for windows vs unix.

> It seems it just forces me to construct manually
> some information that the machine already knows.

Almost, see above. Certainly we could check when the information
provided is wrong (by Cabal doing the dependency chasing rather than
leaving it for the tools like ghc --make or haddock). What we cannot
check is if it is right.


More information about the Haskell-Cafe mailing list