Traversing tree and stopping halfway in Haskell

Posted by Michael War on Stack Overflow See other posts from Stack Overflow or by Michael War
Published on 2010-06-03T16:18:17Z Indexed on 2010/06/03 16:24 UTC
Read the original article Hit count: 180

I want to traverse a tree and return changes to the tree whilst doing so. The result should be a Maybe monad, with Just tree if it succeeds otherwise None.

The question is, what is the cleanest way to stop with the traversing half-way and return None if necessary?

© Stack Overflow or respective owner

Related posts about haskell

Related posts about functional-programming