Another question wrt hiding imports

Simon Peyton-Jones simonpj@microsoft.com
Thu, 12 Jul 2001 06:36:07 -0700


| For instance if a have
|=20
|   module A where
|     data T =3D A | B
|=20
| which entities are imported when I include the declaration
|=20
|   import A hiding(T)
|=20
| in a module? The report is not clear about this but I would=20
| expect that=20
| this imports data constructors A and B into the current=20
| module but not=20
| the type constructor T=20

Yes, that's right.  Why is the report not clear?  More precisely, how
could I improve it?

| However, if this is true it is possible to export data constructors=20
| without their type via
|=20
|   module B(module A) where
|     import A hiding(T)

Indeed so.

| which contradicts the statement in section 5.2 on p.64, that the form=20
| module m is equivalent to listing all entities imported from that=20
| module, because I cannot list a data constructor (without its=20
| type) in an export specification.

Well I suppose I could add "if possible" to the statement that it's
equivalent
to listing all the entities.  Yes it's a little strange, but it's a very
dark corner
and I don't propose to poke in it!  I suspect it may be more confusing
than
helpful to elaborate the exception in 5.2.

Simon