irrelevant package

Simon Marlow simonmar at
Wed Jun 15 07:37:23 EDT 2005

On 14 June 2005 10:55, Serge D. Mechveliani wrote:

>>   When you install a package
>> P that includes a module M, you prevent the user from having any
>> modules called M unless they say '-hide-package P'
> ?
> First, it is very natural to have several common module names among
> the installed packages.
> Suppose the user package P depends on P2, P3. To build P, Cabal finds
> the minimal needed set  S  of packages for  P.

No, Cabal does not do this.

> For my particular aforementioned example, this should be sufficient.
> Because the packages from  S  occur not to have common module names,
> and  ghc-CVS-current  will find this. Right?

I'm not sure what you mean - we don't find the minimal set of
depended-upon packages at all.  You are required to explicitly list
dependencies in the build-depends field.

> Now, suppose, for some another example, it occurs a clash: P2 and P3
> occur in  S  and the name  DPrelude (.hs)  is both in P2 and P3
> (and usually these modules have different interface and
> implementation).
> Probably, the Cabal system needs to  warn  about this.

It's more than just a warning: it's an error.  GHC will issue an error
message in this case.

> But, of course, it is not difficult for Cabal to distinguish these
> two modules. Because it is visible that one is  P2.DPrelude  and
> another is  P3.DPrelude.
> So, before compilation, the modules are resolved.

I don't know what P2.DPrelude means.  Is it a module name, or are you
proposing to prefix module names with package names?

You should read recent discussions on the libraries at mailing
list, where this issue has been dissected at some length.


More information about the Glasgow-haskell-users mailing list