min
09/14/2025, 5:59 AMApplier only work either bottom up or top down but never both?jw
09/14/2025, 1:02 PMjw
09/14/2025, 1:02 PMjw
09/14/2025, 1:04 PMmin
09/15/2025, 10:58 AMinsertBottomUp and insertTopDown are two separate methods. Why can’t an applier let the caller decide how to build a tree? Why should every applier make either a no-op?min
09/15/2025, 10:59 AMlet the caller decide how to build a treeIsn’t this what you’re doing in the code you’ve linked too?
jw
09/15/2025, 11:11 AMjw
09/15/2025, 11:12 AMmin
09/15/2025, 11:14 AM@Composable functions emit data that can be interpreted as a tree to the injected Composer, and it’s the Composer that uses a given Applier. What’s wrong with an implementation of Applier that implements both insertBottomUp and insertTopDown, so each Composer can choose which insertion method to use?jw
09/15/2025, 11:24 AMjw
09/15/2025, 11:25 AMmin
09/15/2025, 11:25 AMmin
09/15/2025, 11:26 AMComposer?jw
09/15/2025, 11:26 AMmin
09/15/2025, 11:29 AMComposer starts at the root, adds nodes top down while traversing down, and then also always comes back up adding nodes bottom up?min
09/15/2025, 11:31 AMroot
2. (going down) root -> A
3. (going down) root -> A -> B
4. (coming back up) root -> A -> X -> B
5. (coming back up) root -> A -> Y -> X -> B
6. (coming back up) Z (new root) -> old root -> Y -> X -> B
Like this?jw
09/15/2025, 12:05 PMA { B { C() } }, the calls would be root/down/A, A/down/B, B/down/C, B/up/C, A/up/B, root/up/Ajw
09/15/2025, 12:05 PMmin
09/15/2025, 12:08 PMApplier takes the nodes that exist at a given point in time, and traverses down and back up the tree to possibly add new nodes without visiting those new nodes during the traversal?jw
09/15/2025, 4:34 PMApplier by moving its current node to the parent, and then invoking any of the manipulation callbacks (insert, move, remove).