[m-rev.] for discussion: subtypes documentation

Fergus Henderson fjh at cs.mu.OZ.AU
Wed Nov 27 18:29:52 AEDT 2002


On 26-Nov-2002, Mark Brown <dougl at cs.mu.OZ.AU> wrote:
> On 25-Nov-2002, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > On 24-Nov-2002, Mark Brown <dougl at cs.mu.OZ.AU> wrote:
> > > +The only subtype of a universally quantified type variable
> > > +is the variable itself,
> > 
> > What about the empty subtype (the one with inst "not_reached")?
> 
> I didn't think of that.  If there is a way to express the empty subtype,
> then this would also be allowed as the subtype of a universal type.

Currently there is a way to express it -- "not_reached" -- but it is
not documented in the language reference manual.

> > For equivalence types, subtypes should certainly be allowed in the body;
> > the semantics of the equivalence type is the same as if the programmer
> > had referred to the subtype directly (i.e. you just replace any uses
> > of the equivalence type with the body, substituting the parameters as usual).
> 
> That would allow the users to attempt to use abstract subtypes, since
> they can define an abstract equivalence type that uses a subtype in the
> implementation.

Well, we could disallow that case, just like we currently disallow
"non-transparent" abstract equivalence types (those whose definition's
RHS has fewer type variables than its LHS).

> Maybe we can let them do that provided we warn them about
> any limitations on the current implementation, but in this first version
> of subtypes I'd rather sacrifice some flexibility than have parts of the
> specification be a little hazy.  We can add more flexibility later.

Fair enough.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
The University of Melbourne         |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-reviews mailing list
post:  mercury-reviews at cs.mu.oz.au
administrative address: owner-mercury-reviews at cs.mu.oz.au
unsubscribe: Address: mercury-reviews-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-reviews-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the reviews mailing list