On 2009 Jan 23, at 17:58, Olex P wrote:
class Vector v where
(^+^) :: v -> v -> v
class Matrix m where
(^+^) :: m -> m -> m
You can't reuse the same operator in different classes. Vector "owns" (^+^), so Matrix can't use it itself. You could say
> instance Matrix m => Vector m where
> (^+^) = ...
allowing Matrix to "inherit" Vector's operator (or turn it around the other way, make it Matrix then make Vector a Matrix), but that's only linguistically possible, not necessarily mathematically sane.
--
electrical and computer engineering, carnegie mellon university KF8NH