
10 Jul
2006
10 Jul
'06
10:53 a.m.
On Mon, 10 Jul 2006, David Roundy wrote:
class Vec v where (.+.) :: v -> v -> v
instance Vec [Double] where xs .+. ys = zipWith (+) xs ys
instance Vec Double where x .+. y = x + y
P.S. This is with ghc 6.4.1. And oddly enough, if you make the instance
instance Num a => Vec [a] where xs .+. ys = zipWith (+) xs ys
What about instance Vec a => Vec [a] where (.+.) = zipWith (.+.) ?