[mercury-users] overloading

Michael Day mcda at students.cs.mu.oz.au
Wed Jul 26 15:28:08 AEST 2000

> How about using non-overloaded names for the class methods,
> and then defining overloaded versions in nested modules
> that just call the non-overloaded versions?

Impressive :) Making the user have to explicitly import the nested modules
is unfortunate though. And the definition of vector as a multi-argument
type class can be difficult:

:- typeclass vector(Vector, Scalar) where [ ... ].

:- pred foo(V, ...) <= vector(V, float). % float not permitted
:- instance vector(list(T), T). % T not permitted

and all the usual type class / instance declaration complaints.

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