X-Comment1: #############################################################
X-Comment2: #     uk.ac.glasgow.cs has changed to uk.ac.glasgow.dcs     #
X-Comment3: #     If this address does not work please ask your mail    #
X-Comment4: #     administrator to update your NRS & mailer tables.     #
X-Comment5: #############################################################


(As you'll have gathered, I'm trying to tie up all the changes to the
report required for a March appearance in SIGPLAN Notices.  That means
finishing by Xmas; hence my recent activity!)


I have two matters concerning import/export/hiding lists I'd like to raise.

Simon

Synonyms
~~~~~~~~
At present a type synonym can be exported by saying

        module A(T)
                type T = Int

The type T is not abstract, because the full synonym is exported.  If T
were declared with a data decl, then T would become abstract.  This seems 
odd.  Mark Jones suggests requiring the form T(..) for exporting or importing
type synonyms, for consistency's sake.  (It also allows a possible future
form of abstraction by exporting a synonym without its representation.)

Under this proposal  the form T would be illegal for type synonyms (T(..) 
is currently illegal).

This proposal interacts slightly with the one below.

Hiding
~~~~~~
Lennart asks:

| If I have an interface
| 
|     interface A where
|     data T = X | Y
| 
| and then do the following
| 
|     module B where
|     import A hiding(T)
|     ...
| 
| Does that mean that only the type is hidden,
| but not the constructors (X, Y)?
| Or is it the same as
| 
|     module B where
|     import A hiding(T(..))
|     ...

This seems like a Jolly Good Question.  It is obviously silly to hide the
type without its constructors.  

Proposal: in hiding lists allow only the forms
                var
                T(..)   -- Types
                C(..)   -- Classes

If we don't adopt the earlier proposal for synonyms we'd need an extra form
T for type synonymns.

Simon

Reply via email to