multiple cabal files in one directory?

Peter Simons simons at cryp.to
Mon Jan 10 12:08:23 CET 2011


Hi Ivan,

 >> Now, the vast majority of Haskell packages doesn't use Setup.hs [...].
 >
 > As far as I'm aware, Setup.hs is still required/recommended [...].

you are right, of course. I expressed myself poorly, and I am sorry
about that. What I meant to say is that the majority of Haskell packages
doesn't add any custom code to Setup.hs. Rather, these packages ship the
standard version of that file, which typically looks like this:

 | module Main (main) where
 |
 | import Distribution.Simple
 |
 | main :: IO ()
 | main = defaultMain

Now, since the majority of packages ship that file, it may look like
Setup.hs is a generic standard component that looks the same in *all*
packages. However, there are packages that ship Setup.hs files that look
very different. The "gtk" package is an impressive example for that.


 > Cabal itself still uses Setup.[l]hs [...].

Yes, that is true. Cabal must use the Setup.hs file, because that file
is actually the main build driver for the package. The know-how encoded
in that file determines how the package is built.

I hope this clarifies the issue.

Take care,
Peter




More information about the Libraries mailing list