-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
foldl : ((a, Zipper/Tree a) -> b -> b) -> b -> Tree a -> b #3
Comments
For now I'll use the following:
Please close this issue if this is a reasonable solution and you don't think a fold like this has a place in the API. Thanks. |
Yeah, that seems like a pretty nice solution! I'm curious if you could give an example use-case for such a function? It would help me think about the API and perhaps alternative ways of tackling the issue. (i.e. whether this is a missing function in |
I happen to be using it to support turing a tree into a Dict (so long as nodes are comparable). I need to do THAT in order to encode my trees and diff them.
|
Thanks, that's super helpful! I'm going to let that sink in a little. I'm wondering whether a The zipper-fold is really growing on me, though I think - if I'm incorporating similar functionality - it makes more sense to do it as part of the |
I need a fold implmenetation which iterates through each (parent, children) tuple in the tree.
Am I correct in saying that this needs to be implemented within the project (as opposed to via the exposed API)?
The text was updated successfully, but these errors were encountered: