Proposal: module namespaces.

Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
28 Feb 2001 16:57:28 GMT


Wed, 28 Feb 2001 17:31:13 +0100, Christian Brolin <Christian.Brolin@carmen.se> pisze:

> This dilemma comes from the fact that you don't tell the compiler what
> module to compile, but just give it some Haskell code. You should always
> compile the module with:
> compile A.B.C.D, i.e. tell the compiler which module you want to
> compile, and the compiler will find the source code.

It must work well with Makefiles. I can imagine that it's doable in
this case, but generally it should work to specify the filename too.

> > I would drop it.
> 
> What? The concept of relative addresses or just my home made dot-syntax?

The dot-syntax, and faced with inability of finding a better scheme -
the concept.

> > Instead I would let the current directory play as an implicit module
> > root. I.e. you can refer to D2 as D2, and in this case you cannot refer
> > to the global module D2 if it exists (but you can refer to D2.Other
> > if D2 is a global directory and there is no local directory named D2).
> 
> I think this is very confusing! And restrictive.

It may be confusing (but not more than having your own function
called sortBy).

It's not restrictive. When you want to use a module, don't provide
a module of the same name - *that* would be confusing when used
(if allowed).

It has an advantage that it's simpler. The compiler has a set of
roots and there is just one form of module paths.

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK