
You're right! I neglected that there is a apostrophe, I should have been
more careful. Thanks for your help!
Regards!
-
wudeng
On Sat, Jul 13, 2013 at 9:46 PM, Kim-Ee Yeoh
On Sat, Jul 13, 2013 at 4:47 PM, Deng Wu
wrote: cfold’ f z (x:xs) = f x z (\y -> cfold’ f y xs)
and gives the test result:
CPS> cfold (+) 0 [1,2,3,4]
The apostrophe matters!
Functions cfold and cfold' (read: see-fold prime) are two different functions, for which you gave the definition of one but not the other.
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.
Let me do the cfold one for you:
cfold :: (a -> r -> r) -> r -> [a] -> r
-- Kim-Ee
_______________________________________________ Beginners mailing list Beginners@haskell.org http://www.haskell.org/mailman/listinfo/beginners