Hi Tom, Thank you for creating the MultiwayTreeZipper. I am attempting to wrap my head around it. My understanding of recursion and recursion on trees has always been spotty. I think I understand how to update a datum when a Forest/Tree is your elm model. However, I have been scratching my head the past couple days trying to figure out how to display the model? I am attempting to use the MuliwayTreeZipper to display comments & responses so I am hoping to have the responses be indented from the comments. Any ideas on how to accomplish that? Thanks Jonathan
On Thursday, November 26, 2015 at 10:01:05 AM UTC-5, Tom Kidd wrote: > > I am working on creating a Tree UI Component that would eventually use the > Elm Architecture. In doing this work, I uncovered the need to be able to > update and navigate tree data structures, and found Huet zippers as a > reasonable starting point. I searched the the elm packages and didn't find > an implementation, so I created one. > > So far, the implementation is not complete (have not implemented > attach/delete), but I believe it is still useful. > > I am looking for feedback because I intend to use this code as a basis for > the Tree Component, which I also intend to share when it is ready. This is > my first package, so before I submitted it, I wanted to get some feedback. > Anyone who is interested in this, please review at the following: > > https://github.com/tomjkidd/elm-multiway-tree-zipper > > > *Resources* > > *LYAH Zippers (used for tree updates)* > http://learnyouahaskell.com/zippers > > *Elm Maybe Monad (needed for possible errors with traversal)* > https://groups.google.com/forum/#!topic/elm-discuss/hEvS6DgNbwM > https://github.com/maxsnew/Scramble/blob/master/Scramble/Utils.elm#L12-L27 > `andThen`, or &> could be used with Zipper a -> Maybe (Zipper a) to > compose them together. > > *Huet Zipper* > > https://www.st.cs.uni-saarland.de/edu/seminare/2005/advanced-fp/docs/huet-zipper.pdf > I still would need to implement the attach and remove functions in order > to create a useful library. > > > -- You received this message because you are subscribed to the Google Groups "Elm Discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
