Skip to content

Instantly share code, notes, and snippets.

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