The callback way is more generic and prevents consing when you don't need to store the resulting node list. You may want to simply print something or maybe modify the node in-place, for example.
Authors found themselves fighting with control flow graph modifications and replaced mutable graph with immutable one, modified by zippers. They achieved speed up of 11% in optimizing transformations, some of which they were unable to implement in mutable version. E.g., more complex optimizations were working faster.
[1] https://web.archive.org/web/20070417190836/https://www.eecs....
Authors found themselves fighting with control flow graph modifications and replaced mutable graph with immutable one, modified by zippers. They achieved speed up of 11% in optimizing transformations, some of which they were unable to implement in mutable version. E.g., more complex optimizations were working faster.