module namespaces with "Prelude"

Alastair Reid
25 Apr 2002 02:00:06 +0100

> 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 it a :set

> Still, the current status is unsatisfactory.  Of the two ways
> forward pointed at above, dropping the implicit roots and putting
> the burden on the programmer to define consistent search paths is by
> far the easiest one to implement.  However, one should bear in mind
> that this will disturb many people, particularly those who don't use
> hierarchical modules.

Perhaps this disruption could be reduced by making the use of implicit
roots a flag you can turn on or off and being careful to avoid
overlapping names in the libraries we distribute with Hugs.

Naive users would then get to use all the libraries but, since naive
users don't use hierarchial namespaces (by my definition :-) they
should not run into these problems.

Sophisticated users would turn off the use of implicit roots and turn
on ambiguous filename checks and would perhaps convert their code to
use hierarchial namespaces.

Alastair Reid