<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jul 13, 2013 at 4:47 PM, Deng Wu <span dir="ltr"><<a href="mailto:wudeng256@gmail.com" target="_blank">wudeng256@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_default" style="font-size:small">cfold’ f z (x:xs) = f x z (\y -> cfold’ f y xs)<br><br>and gives the test result:<br>
<br>CPS> cfold (+) 0 [1,2,3,4]</div></blockquote></div><br></div><div class="gmail_extra">The apostrophe matters!<br><br></div><div class="gmail_extra">Functions cfold and cfold' (read: see-fold prime) are two different functions, for which you gave the definition of one but not the other.<br>
<br></div><div class="gmail_extra">To clear up your confusion, try giving the type signatures for both. Daume's text is normally pretty good about this but the section on cfold falls down in this regard.<br><br></div>
<div class="gmail_extra">Let me do the cfold one for you:<br><br></div><div class="gmail_extra">cfold :: (a -> r -> r) -> r -> [a] -> r<br></div><div class="gmail_extra"><br clear="all"><div>-- Kim-Ee</div>
</div></div>