By on 11/12/2009 8:49 AM ()

Hello Brian,

Thank you for your post(s). They were quite helpful.

However I think that your examples do not show that the cont monad preserves tail recursivity. In fact, visiting the tree is done by the function 'KFoldTree' which is written in CPS. KFoldTree is not written with the help of that monad only 'nodeF' is and 'nodeF' is not recursive itself (I mean it does not call itself from within the cont monad).

So my question is : do you think it is possible to write 'KFoldTree' using the cont monad. I am personnaly not quite sure it is possible to write such thing in a strict language. But I am very interested in any solution.

Regards

J-C

By on 11/13/2009 2:06 AM ()

Sorry, I should have also linked

[link:lorgonblog.spaces.live.com]

and

[link:lorgonblog.spaces.live.com]

This was a blog series fraught with mis-steps, but by the end I had a nice working version that is tail recursive and uses the continuation monad.

By on 11/13/2009 9:14 AM ()
IntelliFactory Offices Copyright (c) 2011-2012 IntelliFactory. All rights reserved.
Home | Products | Consulting | Trainings | Blogs | Jobs | Contact Us | Terms of Use | Privacy Policy | Cookie Policy
Built with WebSharper