package name mismatch

Simon Marlow simonmar@microsoft.com
Thu, 18 Jul 2002 10:59:50 +0100


> Simon Marlow wrote:
> >=20
> > > It must have been only a warning in 5.02.3, or I could never have
> > > compiled it there.  (Before 5.02.3 we didn't use the package
> > > system like this at all.)
> [snip]
> >=20
> > Can't you just fix your build so that the situation doesn't occur?
> [snip]
> In fact I have been unable to reproduce the problem with=20
> ghc5.04 anyway.
> My guess would be that GHC now searches the package=20
> directories before the
> current directory.  So we're all happy, unless someone wants=20
> to override a=20
> module in an imported package.  Even then a better solution=20
> would be to
> write another package containing the altered module, and put=20
> it first in
> the search path.
>=20
> Is the order in which GHC looks for imported modules=20
> specified anywhere?

No, but our position is that you shouldn't have more than one module
with the same name, regardless of whether they are in separate packages
or not, and that the import path for the home package should not overlap
with the import path for any other package.  The only exception is
perhaps two packages that aren't intended to be used together.

Cheers,
	Simon