Skip to content

Instantly share code, notes, and snippets.

@lambdaknight
Created January 16, 2014 23:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lambdaknight/8465187 to your computer and use it in GitHub Desktop.
Save lambdaknight/8465187 to your computer and use it in GitHub Desktop.
Zipper Tree ?
tree :: Tree Int
tree = Node 1 [ Node 2 [], Node 3 [] ]
test = zipper tree
& downward branches
& withins traverse
<&> downward root
<&> focus %~ (\x -> x + 10)
<&> rezip
-- Node {rootLabel = 1, subForest = [Node {rootLabel = 12, subForest = []},Node {rootLabel = 3, subForest = []}]}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment