On Thu, 11 Jun 1998, Sigbjorn Finne wrote:

 | [Hugs accepts:]
 |
 | > import Foo (x)
 | >
 | > z = Foo.y   -- use of y where y is not imported from Foo.

The Haskell Report is very vague about this. But I think it should be a
feature! I think it is a desirable property that, if you import a module,
_all_ the names from that module are imported, but some will be qualified
and the rest won't:

  1. by saying nothing everything is unqualified;
  2. by saying "qualified" everything is qualified;
  3. by providing explicit names, these names are unqualified and the
     rest is qualified;
  4. by using "hiding", these names are qualified and the rest is
     unqualified.

I think all 4 cases are desirable sometimes (it depends on the number of
functions in each category, and the reason why you want to qualify some
and not others).

Case 3. would not be possible without saying an import twice, if you
follow the semantics Sigbjorn expects:

  import qualified Foo
  import Foo ( x )

which is a bit verbose.

Regards,
Koen.

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

Reply via email to