| ... a module that may
 | export an entity of a name that clashes with the Prelude (and hence
 | all Prelude names must be qualified ...

I think this is a really bad property of the Haskell module system.

You should be able to qualify names only when needed.

In Haskell, using let's, we can say:

  let foo = 3
      bar = 4
   in let foo = 5
       in ...

Thereby overruling the first definition of foo.

We should be able to do the same when using modules:

  module Foo where
    foo = 3
    bar = 4

  module Bar where
    import Foo
    foo = 5

If we still want to refer to Foo.foo, we will just use Foo.foo!

So, is there a reason why the following rule is not used:

  If it is ambiguous about what name to use, then qualified names
  should be used.

You could probably even formalize this in a nice way.

Regards,
Koen.

--
Koen Claessen,
[EMAIL PROTECTED],
http://www.cs.chalmers.se/~koen,
Chalmers University of Technology.



Reply via email to