Module names vs file path in Setup.description

Krasimir Angelov ka2_mail at
Tue Aug 10 03:31:59 EDT 2004

--- Isaac Jones <ijones at> wrote:
> Main-is must be a filepath because the module name
> is likely to be
> "Main" and the path is not derivable from the module
> name.


> The "modules" field is module names because the
> system is kinda smart
> about finding the modules, and I hope to make it
> smarter.  Right now,
> it looks for .hs and .lhs files, in the future,
> it'll look for
> Module.happy (or whatever happy's suffix is) and
> maybe Module.hscpp.
> The point is that it'll look for the files and know
> what kind of
> preprocessing is necessary just by the module names.
> If I recall, this
> is what hmake does, and I like the behavior.
> In the future, I hope to deprecate the "modules"
> field for the
> "Simple" tools and it'll just chase down
> dependencies from
> Exposed-Modules and Main-is.

If we change the "modules" field format you can still
use "exposed-modules" to build the package.

> > The "c-sources" also uses list of file paths. When
> using the module
> > names it is easier to determine the file names.
> Maybe it's better to
> > use module names only for "exposed-modules" field.
> I also propose to
> > rename "modules" to "hs-sources".
> So in the future, like I said, I want to deprecate
> "modules" a bit,
> but then again, I want a new field for random files
> to include in the
> sdist, like documentation.

    Why don't add "sources" field which will include
both c-sources and hs-sources. The sources field can
also include .html, .bmp, .gif and any other files.
The file suffix is enough to determine what to do with
it. The package can contain .hs files which are just
examples or test modules. In such case they can be
added to "sources" field but will be unreachable from
the dependency tree.
    I have an idea about tools like happy. Each tool,
distriuted with Cabal, can define rule like 
"*.y -> *.hs". That means: "this tool is used to
compile *.y file to *.hs". Using the file suffix and
the "build-dependency" Cabal can automatically
determine how to compile the file. I don't know
whether this idea was already introduced in the


Do you Yahoo!?
Read only the mail you want - Yahoo! Mail SpamGuard. 

More information about the Libraries mailing list