<br><br><div class="gmail_quote">On Nov 10, 2007 11:54 AM, Ryan Bloor &lt;<a href="mailto:ryanbloor@hotmail.com">ryanbloor@hotmail.com</a>&gt; wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div>hiya<br>
&nbsp;<br>
I was wondering how I would get the second function do recursively do the function for poolNews xs.... tried that and it fails. <br>
&nbsp;<br>
Ryan<br>
&nbsp;<br>
&nbsp;<br><font color="#8080c0" size="2">
<p align="left">--Give wins, draws a rating.</p>
<p align="left">&nbsp;</p></font><font size="2">
<p align="left">poolNews :: Result </p></font><b><font color="#0000c4" face="" size="2">-&gt;</font></b><font face="" size="2"> PoolNews </font><b><font color="#0000c4" face="" size="2">-&gt;</font></b><font face="" size="2">
 PoolNews
<p align="left">poolNews (a,b,c,d,e) (home,away,goaless,scoredraw) </p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | c &gt; d = (home+1,away,goaless,scoredraw) </p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | c &lt; d = (home,away+1,goaless,scoredraw)&nbsp; </p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; |(c == 0) &amp;&amp; (d == 0) = (home+1,away,goaless+1,scoredraw) </p>
<p align="left">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; | </p></font><b><font color="#40c0c0" size="2">otherwise</font></b><font face="" size="2"> = (home,away,goaless,scoredraw+1)</font>
<p align="left"><font face="" size="2">&nbsp;</font></p>
<p align="left"></p>
<p align="left"><font color="#8080c0" size="2">--Do for all Results</font></p><font size="2">
<p align="left">poolNewsB :: Results </p></font><b><font color="#0000c4" face="" size="2">-&gt;</font></b><font face="" size="2"> PoolNews
poolNewsB (x:xs) = poolNews x (0,0,0,0)<br></font></div></blockquote><br>As Andrew points out, really what you want is a fold.&nbsp; However, perhaps you&#39;re not supposed to use such Prelude functions in your assignment?&nbsp; The real issue here is that your definition of poolNewsB does not do anything with xs.&nbsp; You need to somehow incorportate a recursive call that will process the rest of the list (xs) as well as the first item (x).
<br><br>Hope that helps!<br>-Brent<br></div>