[mercury-users] variable parameters in typeclass instances

Juergen Stuber juergen at mpi-sb.mpg.de
Fri Nov 5 00:04:33 AEDT 1999


Fergus Henderson <fjh at cs.mu.OZ.AU> writes:
> 
> Possibly, but only if we can find some nice solutions to (or at least
> work-around for) the problems.
> 
> > The reason I ask is that it would appear to be necessary to do anything
> > useful with constructor classes when implementing collections.
> 
> You may be right.  And having a nice solution to generic collection
> classes is a very important goal.  Finding the optimum point in this
> design space is a tricky exercise.  For more details on this, see [1].

I think something like mode declarations for typeclasses would help here.
With these we could state dependencies between the types of a typeclass,
and checking for overlapping instances would be similar
to determinism checking.
Even the name mangling should work by ignoring "out" arguments.

Maybe this is related to the "functional dependencies" some
Haskell people recently started talking about?

Jürgen

-- 
Jürgen Stuber <juergen at mpi-sb.mpg.de>
http://www.mpi-sb.mpg.de/~juergen/
--------------------------------------------------------------------------
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