module namespaces with "Prelude"

Hal Daume III hdaume@ISI.EDU
Thu, 25 Apr 2002 07:08:23 -0700 (PDT)

> > >> All in all, dropping all implicit directories from the search
> > >> path gets my vote.
> > >
> > > "me too".

I vote for this provided "." isn't implicitly in the search path either.

Or, rather, I vote for that assuming that my proposal [see below] isn't
going to be accepted, which I'm pretty sure it won't, but I'll put it out
there anyway.

As I see it, a large part of the problem comes when using the
interpreters, not the compilers.  Why?  Because we can specify *either*
module names *or* file names as the parameters to :load.  Proposal: you
may *only* specify module name as the parameter to load.  Then, when
loading this module, if it's name is X.Y then take the *first* x in the
search path such that there exists a file x/X/Y.(l)hs and load this file.

If you make sure that "." isn't in the search path, my initial problem
goes away.  If someone always wants "." in the search path, then they can
say -i. which I don't think is a big deal.  Or, if you don't want to upset
people, you could have "." in the search path but have an option
--no-implicit-dot to turn it off which I would just put as a default

The only thing this breaks is modules named Main, which I don't like
anyway.  I think that any module that exports a function main of type IO
() should be able to be compiled as an executable.  So I could have a main
:: IO () in my NLP.Foo.Bar.FooBar module and would be able to compile that
without changing the module name.  <-- this is why i don't think this
proposal will be used.

So, my vote is for nothing implicit in the search path, including ".",
barring that, have a --no-implicit-dot option.

 - Hal