<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Verdana
}
--></style>
</head>
<body class='hmmessage'>
<font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; ">Can someone provide a hand calculation of:</span></font><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; "><br></span></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; ">&nbsp;&nbsp; &nbsp;span (&lt; 0) [-1, -2, -3, 0, 1, 2, -3, -4, -5]?</span></font><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; "><br></span></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; ">I know the result is ([-1, -2, -3], [0, 1, 2, -3, -4, -5]), but the recursion flummoxes me.</span></font></div><div><font class="Apple-style-span" face="'Courier New'"><br></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; ">Here's the Prelude definition:</span></font></div><div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; "><br></span></font></div><div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; ">&nbsp;&nbsp; &nbsp;mySpan &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; :: (a -&gt; Bool) -&gt; [a] -&gt; ([a], [a])</span></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; ">&nbsp;&nbsp; &nbsp;mySpan _ [] &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;([], [])</span></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; ">&nbsp;&nbsp; &nbsp;mySpan p xs@(x:xs')</span></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;| p x &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;(x:ys, zs)</span></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp;| otherwise &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;= &nbsp;([], xs)</span></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; where</span></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; ">&nbsp;&nbsp; &nbsp; &nbsp;</span></font><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; ">&nbsp;&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (ys, zs) = mySpan p xs'</span></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; "><br></span></font></div><div><font class="Apple-style-span" face="'Courier New'"><span class="Apple-style-span" style="font-size: 10pt; ">Thanks.</span></font></div><div><br></div></div></div></div>                                               <br /><hr />Hotmail has tools for the New Busy. Search, chat and e-mail from your inbox. <a href='http://www.windowslive.com/campaign/thenewbusy?ocid=PID28326::T:WLMTAGL:ON:WL:en-US:WM_HMP:042010_1' target='_new'>Learn more.</a></body>
</html>