Messing around in Haskell getting to know type classes more intimately, but I've hit a bit of a roadblock. For whatever reason I'm not allowed to make an instance of my Vector
class. I'm being told that it's an illegal instance declaration because I don't have distinct type variables? What's going on here?
class Vector v where
vplus :: v -> v -> v
vmult :: Num a => v -> a -> v
instance Num a => Vector (a, a) where
(a, b) `vplus` (c, d) = (a + c, b + d)
(a, b) `vmult` m = (a * m, b * m)