title: Haskell binary tree
body: <p>I have a homework:</p>
  
  <p>1) define a data structure <code>TTT</code> for the tree where each vertex has 0, 1 or 2 children and each tree leaf(vertex with 0 children and itself) contains a list of natural numbers;</p>
  
  <p>2) create a function <code>mm</code> which has 2 arguments - function <code>f(Integer-&gt;Integer)</code> and <code>TTT</code> based tree <code>x</code>. In result it should give <code>TTT</code> based tree which is made from <code>x</code> using function <code>f</code> for each element in the list(referenced to the 1) definition);</p>
  
  <p>Function <code>f</code> can have following representations(<code>a</code>, <code>b</code> or <code>c</code>):</p>
  
  <pre><code>a :: Integer -&gt; Integer
  a x = x * x
  
  b :: Integer -&gt; Integer
  b x = x `mod` 9
  
  c :: Integer -&gt; Integer
  c x = x * x * x
  </code></pre>
  
  <p>Can anybody help me with this?</p>