19 Jan
2009
19 Jan
'09
1:36 p.m.
A fragment of an attempt to make pairs serve as complex numbers, using ghc/hugs extensions: instance Num a => Num (a,a) where (x,y) * (u,v) = (x*u-y*v, x*v+y*u) Unfortunately, type inference isn't strong enough to cope with (1,1)*(1,1) Why shouldn't it be strengthened to do so? Or is there a declarative trick (perhaps with dependent classes) that will accomplish the goal? Doug McIlroy