title: Finding the leaves of an inductively-defined tree
body: <p>So, I have a function of type:</p>
  
  <pre><code>genTree :: Node -&gt; [Nodes]
  </code></pre>
  
  <p>Given a node, this function generates the set of children of that node in a tree.  The function can be applied again to those children to generate their children, until it eventually generates a node with no children, i.e. a node for which genTree returns [].</p>
  
  <p>What I'm trying to do is, given a starting node, generate the list of all leaf nodes in the tree that has it as the root.</p>
  
  <p>Any advice?</p>