Apply a function to each leaf of a (possibly nested) list, preserving the
tree structure. Equivalent to flattening .x with flatten(), applying
.f to each leaf, and reassembling with unflatten().
Value
An object with the same nesting structure as .x, where each leaf
is the result of .f(leaf, ...).