Map a function at a given level of a tree

It can be done with a recursive definition like this:

2 Likes