[bitc-dev] Vectors with mutable elements

Swaroop Sridhar swaroop at cs.jhu.edu
Mon May 22 14:04:47 EDT 2006


Swaroop Sridhar wrote:
> So, let me propose that we write the character class as:
> 
> (deftypeclass (LitChar 'a)
> 	(tyfn () 'a))
> 
> (definstance (LitChar char))
> (definstance (Litchar (mutable char))


This is a bug. Prof. Shapiro pointed out this mistake today morning.
Because of the (tyfn () 'a) we cannot define two instances of the form

(definstance (LitChar char))
(definstance (Litchar (mutable char))

According to the Functional dependencies paper, if there is a functional 
dependency X ~> Y, then for two instances t and s, if tX = sX, then it 
must be the case that tY = sY, where tX and sX are the X part and the tY 
and sY are the Y part of the typeclass arguments.


Swaroop.



More information about the bitc-dev mailing list