<br><br><div><span class="gmail_quote">On 11/6/05, <b class="gmail_sendername">Klaus Ostermann</b> &lt;<a href="mailto:ostermann@informatik.tu-darmstadt.de">ostermann@informatik.tu-darmstadt.de</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>instance Node Person where<br>&nbsp;&nbsp; isConnectedTo g n (p1,p2) = (p1 == n) || (p2 == n)<br>
</blockquote><div><br>
At this point, isConnectedTo knows nothing about the third argument
except that it is an edge, and there's no reason to think that an Edge
is a tuple.&nbsp; All you can say is that there are two functions, n1
and n2, which extract the nodes of the edge.&nbsp; Use those instead,
for example<br>
<br>
isConnectedTo g n p = n == n1 p || n == n2 p<br>
<br>
</div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">&nbsp; Couldn't match the rigid variable `e' against `(a, b)'<br>&nbsp;&nbsp;&nbsp;&nbsp;`e' is bound by the type signature for `isConnectedTo'
<br>&nbsp;&nbsp;&nbsp;&nbsp;Expected type: e<br>&nbsp;&nbsp;&nbsp;&nbsp;Inferred type: (a, b)<br>&nbsp;&nbsp;When checking the pattern: (p1, p2)<br>&nbsp;&nbsp;In the definition of `isConnectedTo':<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;isConnectedTo g n (p1, p2) = (p1 == n) || (p2 == n)</blockquote><div><br>
Hopefully this error makes more sense now.&nbsp; It's saying that it expected something of type 'e', but it found a tuple.<br>
<br>
</div></div>regards,<br>
Fraser.<br>