How can I generate a tree with n nodes, each of which have m number of children, with the condition that each child node is obtained by fun(parent)?
I've gleaned some logic from this post, but I am stuck on how to generate up to n names, and also how to generate the functions for assigning newly generated children to their parents recursively. (insert utopian joke here)
-Edit-
I've attempted using TheTime's solution below, and this certainly answered this question. However, I didn't ask the question I intended. Because this question has a good answer that could be useful in certain circumstances, I've posted a new question that asks what I really meant here.