module namespaces with "Prelude"

Simon Marlow simonmar@microsoft.com
Thu, 25 Apr 2002 18:05:59 +0100


> On Thursday, April 25, 2002, at 03:00 , Alastair Reid wrote:
>=20
> >> Now, since there's nothing that prevents the directory hierarchies
> >> starting at these roots from overlapping, we have a potential for
> >> ambiguity when we want to map module names to filenames.
> >
> > This suggests that we might want to modify the search algorithm to
> > find all matches and report and error if two or more candidate files
> > are found.  If this is a big performance hit, we could make=20
> it a :set
> > option.
>=20
> But wouldn't that just prohibit the use of module names that=20
> also appear in the standard libraries?  At least we need to stop=20
> searching the directory of the importing module to make=20
> something useful of this idea.

I agree with Alastair - I think it should be an error if there are two
modules with the same name on the search path.  If it weren't for (a)
the performance hit and (b) the difficulty in portably determining
whether two pathnames refer to the same file, I'd have made GHCi do this
already.

Yes, it would prohibit the use of module names that also appear in the
standard libraries.  But after all we're moving to hierarchical
libraries so there's no need to do that any more!

Cheers,
	Simon