[mercury-users] higher order types + type class constraints
Michael Day
mikeday at corplink.com.au
Tue Nov 28 20:10:50 AEDT 2000
> You can't. In fact you can't pass around polymorphic higher-order
> terms at all. Mercury does not directly support "first class polymorphism".
Is that a limitation that will be removed at some undefined point in the
future, or just something that people will have to work around?
> The work-around goes like this.
> Define a typeclass with a single method whose type matches
> the type of the higher-order pred term that you want to pass,
> but with the typeclass parameter as an additional argument:
That's very clever :)
Thanks!
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