[mercury-users] typeclass constraint on type definition... wrong
Robert Bossy
bossy at ccr.jussieu.fr
Thu May 27 00:34:13 AEST 1999
Hello,
I tried the following
:- typeclass foo(T) where [].
:- type bar(T) ---> bar(T) <= foo(T).
I meant a declaration of the type bar, parametric on the type variable T since T is an instance of typeclass foo.
And it didn't work...
Is it semantically wrong? If not how to write it?
The error is "undefined type foo/1"... so what does
:- type foo(T) ---> foo(T).
:- type bar(T) ---> bar(T) <= foo(T).
mean?
Thanks,
Robert Bossy
bossy at ccr.jussieu.fr
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mercurylang.org/archives/users/attachments/19990526/9c46b5bb/attachment.html>
More information about the users
mailing list