<div class="gmail_quote">2009/1/23 Olex P <span dir="ltr">&lt;<a href="mailto:hoknamahn@gmail.com">hoknamahn@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello Haskellers!<br>It&#39;s probably a simple question but I can&#39;t find a proper solution...<br>Suppose we have a class Vector which overloads (+) operation. I&#39;d like to represent a Matrix data type as a set of vectors:<br>

<br>data Matrix3 = M3 !Vector3 !Vector3 !Vector3<br><br>In this case (+) for matrices could be implemented as:<br><br>&nbsp;(M3 r11 r12 r13) + (M3 r21 r22 r23) = M3 (r11 + r21) (r12 + r22) (r13 + r23)<br><br>But GHC says about ambiguous occurrence. I don&#39;t understand why because it&#39;s should be pretty clear that rows are vectors and (+) has to be vector type as well. I could use Vector.+ instead but it doesn&#39;t look good.<br>

Probably I&#39;m missing something. Any ideas?</blockquote><div><br></div><div>I&#39;m am seeing an image. &nbsp;It&#39;s a... a Vector class, with an operation (+). &nbsp;Oh, he&#39;s with another one though. &nbsp;It&#39;s the Num class. &nbsp;Oh they&#39;re fighting over the (+). &nbsp;Vector is trying to take it from Num, but Num isn&#39;t letting go.</div>
<div><br></div><div>Why doesn&#39;t Vector see that there is a whole pile of operations neglected in the corner, like (^+^), (.+.). &nbsp;He just really wants that (+), huh...</div><div><br></div><div>Luke</div></div>