-
Notifications
You must be signed in to change notification settings - Fork 177
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
A few more extractors for Data.Tree #140
base: master
Are you sure you want to change the base?
Conversation
Hello, thanks for spending time improving Nevertheless, as noted in the README, please note that all API enhancements should be discussed on libraries@haskell mailing list. Please follow https://wiki.haskell.org/Library_submissions#Guide_to_proposers and start a discussion there. |
I apologize! I'll present these ideas to the list and keep this thread up-to-date on any progress. Sorry about this. |
Do not apologize, it is perfectly fine. The process of public discussion is quite unexpected (at least it was for me when I started with this). However, it allows people to be involved in API design of widely used packages (or at least monitor it) and it makes the API changes better (people can discuss proper names, parameters, consistency with other similar libraries [that is not the case with |
@athanclark, how was your proposal received on the list? |
I also have some doubts about the efficiency of these. Might it be better to form the paths backwards and then reverse them? |
Wouldn't forming the paths backwards and later reversing them greatly hinder laziness and make the operations on infinite trees impossible? |
@recursion-ninja, that's a problem, for sure, but I think there's already a problem. Look at the definition of paths (Node a as) = map (a:) $ concatMap paths as The first element of the result is strict in the first element of |
@athanclark Are you still hoping to get some of these in? I haven't seen a libraries proposal or any progress on efficient implementation. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AFAICT @treeowl's concerns need to be addressed.
I've found some use-cases for looking at all the "paths" that a tree has within it - both "complete" paths (all transitively connected nodes from the root to the end-points), and "partial" paths (all steps in-between on the paths).
The two functions I've added shouldn't clash with other namespaces easily, and they're simple enough to see they are correct. I haven't added any quickcheck tests or criterion benchmarks yet, please let me know if you'd like me to do this.
Thank you for maintaining this beast of a library! I'd also like to fulfill some of the wishes in #39 later if possible.