<div dir="ltr"><div>The folks in the #haskell-lens irc channel helped me out. Installing and importing <a href="http://hackage.haskell.org/package/zippers">http://hackage.haskell.org/package/zippers</a> fixed my problem. Sounds like it was split out of the lens package at some point.<br></div><div><br></div><div>-Zach</div><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Dec 7, 2014 at 11:08 AM, Zach Moazeni <span dir="ltr"><<a href="mailto:zach.lists@gmail.com" target="_blank">zach.lists@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hello,<div><br></div><div>I'm trying to understand how I would manipulate a Data.Tree in Haskell. I came across this StackOverflow answer and accompanying blog post, but it doesn't run locally for me:</div><div><br></div><div>* <a href="http://stackoverflow.com/a/15489761/410759" target="_blank">http://stackoverflow.com/a/15489761/410759</a><br></div><div>* <a href="https://www.fpcomplete.com/user/davorak/code-snippets/zipper-tree-examples" target="_blank">https://www.fpcomplete.com/user/davorak/code-snippets/zipper-tree-examples</a></div><div><br></div><div>Here's a gist with the code and the error I'm seeing: <a href="https://gist.github.com/zmoazeni/0049f3ab365ae600b131" target="_blank">https://gist.github.com/zmoazeni/0049f3ab365ae600b131</a></div><div><br></div><div>I just want to start slow and be able to do three actions:</div><div><br></div><div>* add +10 to all values in the tree</div><div>* add a node to an existing node's subForest</div><div>* remove a node (along with its subForest) from the tree</div><div><br></div><div>I understand that this won't actually "edit in place" and my code would need to call a function which would return an updated version of the original tree.</div><div><br></div><div>Finally, Lens wasn't my first choice. I was trying to understand Zippers from <a href="http://learnyouahaskell.com/zippers" target="_blank">http://learnyouahaskell.com/zippers</a> and my brain seized. I'm just falling back to Lens because it seems like the simplest/dsl-ish way to manipulate structures like this.</div><div><br></div><div>Thanks for any help!</div><span class="HOEnZb"><font color="#888888"><div>-Zach</div></font></span></div>
</blockquote></div><br></div></div>