[mercury-users] higher order types + type class constraints
Michael Day
mikeday at corplink.com.au
Tue Nov 28 18:37:25 AEDT 2000
How does one pass around higher order terms that have type class
constraints?
This is not correct:
:- pred foo(pred(C, C) <= something(C), other args ...).
:- mode foo(pred(di, uo) is det, other args ...) is det.
While this compiles, but doesn't work:
:- pred foo(pred(C, C), other args ...) <= something(C).
:- mode foo(pred(di, uo) is det, other args ...) is det.
foo(P, others ...) :-
create C0,
P(C0, C) % error here, expects type to be `C'
Any suggestions? Which section of the reference manual should have this,
higher order section or type class constraints section?
Michael
--------------------------------------------------------------------------
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