A comment came to me in private mail, and I felt that this was a better
place to answer it. The author wrote:

I do like your notion of type classes working with lexical scope, but have
no idea how it will play out in a real language.

I think it is safe to say that *we* don't know how it will work out either,
but here is the thinking (such as it is):


   1. The present "no collisions allowed" rule really violates separate
   compilation. It is the type of rule that is *guaranteed* to get violated
   by libraries at some point, and is therefore not well suited to a language
   where we hope that useful libraries will emerge.
   2. The other problem with type classes is specializations. The problem is
   that choosing the "best" specialization is inherently ambiguous (it's the
   same problem as C++ overload resolution). Pushing that back into the lexical
   context doesn't solve the ambiguity, but it does put the control of
   resolution order into a place where the programmer can control it
   explicitly.


shap
_______________________________________________
bitc-dev mailing list
[email protected]
http://www.coyotos.org/mailman/listinfo/bitc-dev

Reply via email to