Hi,

Actually what I would really like to be able to do is to have a
type T1(T2) as the parameter to a typeclass.  An example of the
type of thing I'd like to be able to do is:

:- typeclass mytype(T1(T2)) where [
        pred lookup(T1(T2), int, T2),
        mode lookup(in, in, out) is det
].

:- instance mytype(list(float)) where [
        pred(lookup/3) is list__index0_det
].

:- instance mytype(array(float)) where [
        pred(lookup/3) is array__lookup
].

:- instance mytype(array(int)) where [
        pred(lookup/3) is array__lookup
].

Is there any way to do this in Mercury?

Thanks,
Merrielle

-- 
m.spain@ugrad.unimelb.edu.au
--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users@cs.mu.oz.au
administrative address: owner-mercury-users@cs.mu.oz.au
unsubscribe: Address: mercury-users-request@cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request@cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------

