[mercury-users] variable parameters in typeclass instances
Ralph Becket
rbeck at microsoft.com
Thu Nov 4 01:19:36 AEDT 1999
> it does not appear to be possible to state the following:
>
> % everything is an instance of the "pointless" typeclass:
> :- instance pointless(_).
>
> % everything and int satisfy the "strange_relation" typeclass:
> :- instance strange_relation(int, T).
>
> do these declarations have semantic problems that make them undesirable,
> or will they be supported in a future version of the compiler?
Er, why not just define polymorphic predicates for this sort of thing.
There's no need to use typeclasses here.
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