[mercury-users] name clashes in typeclasses

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Oct 7 00:39:18 AEST 1999


On 06-Oct-1999, Michael Day <mikeday at corplink.com.au> wrote:
> 
> is it possible for two type classes in the same module to contain a
> predicate with the same name?

Only if the two predicates have different arity, or occur in different
sub-modules.

> If not, would it be possible for these
> predicates to be qualified by type class name in some way? If a queue and
> a stack are both declared in the same module it appears that they can't
> both have a method called "push". It would be nice if the methods could be
> referred to as stack.push and queue.push (or stack__push or whatever) in a
> similar way to module qualifiers. Okay in this case it's not unreasonable
> to separate the two type classes in different modules, but still on some
> occasions it could cause some grief...

Have you considered using sub-modules?

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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