[m-dev.] Ye Olde Subtyping Proposal

Ralph Becket rafe at cs.mu.OZ.AU
Mon Nov 18 22:48:10 AEDT 2002


Fergus Henderson, Monday, 18 November 2002:
> > We would clearly need to add something to type checking to
> > handle these cases, but I don't see why that would be a
> > major effort.  Of course, I haven't mucked about in the
> > type checker yet...:-)
> 
> Actually subtypes would need to get checked in the mode checker, not the
> type checker, because you need to know the direction of data-flow in
> order to check subtypes.  The mode checker already handles structural
> subtyping, but it would require some non-trivial changes to support
> by-naming subtyping for abstract insts.

We have a number of places that need tweaking to make this change, but
putting in a subtyping relation that is checked by the type checker
shouldn't be too hard, surely?  Then we could add the insts directly to
the .int files and not have to worry about adding a subinst check to the
mode checker since the type checker would already have done the job.  I
acknowledge that it's probably a case of six and two threes, but on
aesthetic grounds this feels like a type checker job to me.

- Ralph
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list