[m-rev.] for review: allow arbitrary types in class constraints

David Jeffery dgj at missioncriticalit.com
Fri Apr 12 20:42:53 AEST 2002


> 
> But there shouldn't be any problems with allowing 'arbitrary'
> constraints on predicate types.
> 

I should add that, while there shouldn't be any problems for
the type checker in allowing 'arbitrary' constraints on predicate
types, I've got a feeling that it may cause problems further down
the line for some sorts of constraints. These problems are
associated with the fact that, for constrained types, we nest the
type-info inside the typeclass-info, and the representation of
the typeclass-info makes some assumptions about what the
form of the form of those types.

For example, with

:- pred p(T) <= c(f(T)).

I've got a feeling that the later stages of the compiler will barf.
(The problem being that the type_info_locn type has no way
of specifying that type-info for T can be found inside something
which is inside the typeclass-info for c(f(T))). It should be possible 
to make it work, but I suspect it won't "just" work (in all cases).


dgj

--------------------------------------------------------------------------
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