This function is kind of mix between `reduce` & `walk` and name is too generic to actually mean something. I'd suggest renaming it to `accumulate` and later when we have more time we can nerd out on how trees can / should be implemented.

Also please add a comment on what this function does, what is it for, and how to use it. It's really not obvious.