[mercury-users] list functor style functions

Ralph Becket rbeck at microsoft.com
Fri Nov 12 23:21:31 AEDT 1999


> Obviously the error message here is not a good one.
> But what the compiler is complaining about is the type `T'
> in the second argument of the instance declaration for `sequence'.
> The error is that this does not meet our current set of restrictions
> on instance declarations, namely that types in instance declarations
> must all be of the form `<typeconstructor>(<TypeVar1>, ..., 
> <TypeVarN>)'
> for some N >= 0.

I'll submit a bug report for that one, then.  I tried the following just
for kicks (it's illegal under the current restrictions)...

:- type thing(T) == T.

:- instance sequence(my_list(T), thing(T)) where [...].

And the compiler threw an exception.

Hmm, this restriction (no free type variables as instance arguments) could
be a bit of a pain.

Ralph
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list