[Haskell-beginners] cps in yaht

Deng Wu wudeng256 at gmail.com
Sat Jul 13 17:01:43 CEST 2013


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 <ky3 at atamo.com> wrote:

>
> On Sat, Jul 13, 2013 at 4:47 PM, Deng Wu <wudeng256 at gmail.com> 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 at haskell.org
> http://www.haskell.org/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/beginners/attachments/20130713/e0c74a04/attachment-0001.htm>


More information about the Beginners mailing list