Skip to content

Instantly share code, notes, and snippets.

@lambdaknight
Created January 16, 2014 23:01
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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