Well if telepaths on vacation...<br><br>class Vector v where<br> (^+^) :: v -> v -> v<br><br>data Vector3 = V3 !Double !Double !Double<br><br>instance Vector Vector3 where<br> (V3 x1 y1 z1) ^+^ (V3 x2 y2 z2) = V3 (x1 + x2) (y1 + y2) (z1 + z2)<br>
<br>class Matrix m where<br> (^+^) :: m -> m -> m<div class="Ih2E3d"><br><br>data Matrix3 = M3 !Vector3 !Vector3 !Vector3<br><br></div>instance Matrix Matrix3 where<div class="Ih2E3d"><br> (M3 r11 r12 r13) ^+^ (M3 r21 r22 r23) = M3 (r11 ^+^ r21)<br>
(r12 ^+^ r22)<br>
(r13 ^+^ r23)<br><br></div>Hope this is better :)<br>So yeah... r11 ^+^ r21 just doesn't work.