[bitc-dev] Confusion: multiparameter type classes
Jonathan S. Shapiro
shap at eros-os.org
Sun Jul 24 13:53:35 EDT 2005
I am confused about a detail concerning multiparameter type classes.
What is the difference between the single parameter type class:
(deftypeclass (TC 'a:(tuple 'b 'c)) ...methods...)
and the multiparameter type class
(deftypeclass (TC 'b 'c) ...methods...)
w.r.t. the issues raised in the functional dependencies paper?
That is, it appears to me that if we introduce constraints without
explicitly introducing multiparameter type classes, and allow the
methods to reference the inner types 'b and 'c *without* explicitly
referencing 'a, we run into many of the same issues of dependent and
independent types that functional dependencies resolve.
Q1: Is this about right?
Q2: Is it therefore reasonable to consider a typeclass "TC 'a ... 'z" to
be a constrained *subtype* of a product type:
TC : ('a ... 'z)
because if so, it would follow that we *could* in fact instantiate
instances of TC in a sensible way -- albeit not the way that may have
been envisioned by the programmer.
More information about the bitc-dev