From 19005f3ca33d441077b5f900f3e1da5cb8139437 Mon Sep 17 00:00:00 2001 From: Logan Allen Date: Wed, 24 Feb 2021 19:14:18 -0600 Subject: [PATCH] graph: rewrite +tap-deep to function properly --- pkg/arvo/app/graph-push-hook.hoon | 4 +++- pkg/arvo/lib/graph.hoon | 32 ++++++++++++------------------- 2 files changed, 15 insertions(+), 21 deletions(-) diff --git a/pkg/arvo/app/graph-push-hook.hoon b/pkg/arvo/app/graph-push-hook.hoon index 7f82525d52..94a83463be 100644 --- a/pkg/arvo/app/graph-push-hook.hoon +++ b/pkg/arvo/app/graph-push-hook.hoon @@ -105,7 +105,9 @@ ^- (list [index:store node:store]) ?: ?=(%empty -.children.node) ~ - (turn (tap-deep:gra p.children.node) empty-children) + %+ turn + (tap-deep:gra index p.children.node) + empty-children :: ++ empty-children |= [=index:store =node:store] diff --git a/pkg/arvo/lib/graph.hoon b/pkg/arvo/lib/graph.hoon index 4f8ebe37b8..dbb11bcf82 100644 --- a/pkg/arvo/lib/graph.hoon +++ b/pkg/arvo/lib/graph.hoon @@ -104,27 +104,19 @@ resources.q.update :: ++ tap-deep - |= =graph:store + |= [=index:store =graph:store] ^- (list [index:store node:store]) - =| =index:store - =/ nodes=(list [atom node:store]) - (tap:orm:store graph) - |- =* tap-nodes $ - ^- (list [index:store node:store]) - %- zing - %+ turn - nodes - |= [=atom =node:store] - ^- (list [index:store node:store]) - %+ welp - ^- (list [index:store node:store]) - [(snoc index atom) node]~ - ?. ?=(%graph -.children.node) - ~ - %_ tap-nodes - index (snoc index atom) - nodes (tap:orm:store p.children.node) - == + %+ roll (tap:orm:store graph) + |= $: [=atom =node:store] + lis=(list [index:store node:store]) + == + =/ child-index (snoc index atom) + =/ childless-node node(children [%empty ~]) + ?: ?=(%empty -.children.node) + (snoc lis [child-index childless-node]) + %+ weld + (snoc lis [child-index childless-node]) + (tap-deep child-index p.children.node) :: ++ get-mark |= res=resource