[Haskell-cafe] Re: cabal, haddock, hscolour
duncan.coutts at googlemail.com
Wed Aug 18 10:33:30 EDT 2010
On 18 August 2010 15:13, 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" ...
>> Enforcing it properly is on the TODO list.
> Please don't ... there's the design principle of
> "making the typical case easy, but the complicated case possible"
> (or something similar to that effect). It seems that
> you plan to make the typical case cumbersome.
Enforce is the wrong word. The more friendly thing is to tell users
when the list is incomplete.
As I mentioned before, in general it is necessary to list all the
modules because in general it is impossible to discover them all
automatically. Further, even when it is possible, there is value in
not requiring all tools that process .cabal files to embed all the
dependency chasing logic. Listing other modules also means we can
discover the full set of modules without having to configure and build
the package (in general it requires configuring the package, and then
compiling and running preprocessors).
Alternatively we could decide that we will allow users to specify
other modules just for the cases where discovering all the modules is
hard/impossible and then require all tools that handle .cabal files to
contain the logic for dependency chasing.
IMHO, the ideal is when cabal can mostly work without any .cabal file
for simple programs and then provides help to make and maintain
accurate .cabal files.
> The question in this thread is about generating hscolourized source.
> Everything else is working fine already - haddock is run on all modules
> (in the transitive import closure - how is it computed?),
> it's just that hscolour is not run.
> I hoped there is an easy fix for that (= hack, if you want).
> Actually, I don't need cabal here. Perhaps haddock should compute
> the module import closure (and then run hscolour)?
That would also work. That is independent of the need to list all
modules in the .cabal file.
> For reference, you don't need to list all source files here:
Right, if you do not have any preprocessing or conditional compilation
then import chasing is relatively easy and will cover all modules.
More information about the Haskell-Cafe