infelicity in module imports

Wolfgang Lux wlux@uni-muenster.de
Thu, 12 Jul 2001 10:28:02 +0200


Koen Claessen wrote

> What I would like to see in the report are *examples*.
> Namely what happens in each of the following cases:

Ok, let me try:

>   import A
visible: x, y, p, q, v, w, A.x, A.y, A.p, A.q, A.v, A.w

>   import A()
nothing imported

>   import A(x,y)
visible: x, y, A.x, A.y

>   import qualified A
visible: A.x, A.y, A.p, A.q, A.v, A.w

>   import qualified A()
nothing imported

>   import qualified A(x,y)
visible: A.x, A.y

>   import A hiding ()
like import A

>   import A() hiding ()
>   import A(x,y) hiding ()
these two are not legal, you have either and list of included entities 
or a list of hidden entities both not both.

>   import A hiding (p,q)
according to report this would import x, y, v, w, A.x, A.y, A.p, A.q, A.v, A.w
with the revision of the report A.p and A.q no longer are visible

>   import A() hiding (p,q)
>   import A(x,y) hiding (p,q)
both are not legal

>   import qualified A hiding ()
like import A
>   import qualified A() hiding ()
>   import qualified A(x,y) hiding ()
both not legal

>   import qualified A hiding (p,q)
either A.x, A.y, A.p, A.q, A.v, A.w (according to the report) or
A.x, A.y, A.v, A.w (when the report is changed as Simon proposed)

>   import qualified A() hiding (p,q)
>   import qualified A(x,y) hiding (p,q)
both not legal

Regards
Wolfgang


--
Wolfgang Lux				  Phone: +49-251-83-38263
Institut fuer Wirtschaftinformatik	    FAX: +49-251-83-38259
Universitaet Muenster		      Email: wlux@uni-muenster.de