title: How do you represent nested types using the Scott Encoding?
body: <p>An ADT can be represented using the Scott Encoding by replacing products by tuples and sums by matchers. For example:</p>
  
  <pre><code>data List a = Cons a (List a) | Nil
  </code></pre>
  
  <p>Can be encoded using the Scott Encoding as:</p>
  
  <pre><code>cons = (λ h t c n . c h t)
  nil  = (λ c n . n)
  </code></pre>
  
  <p>But I couldn't find how nested types can be encoded using SE:</p>
  
  <pre><code>data Tree a = Node (List (Tree a)) | Leaf a
  </code></pre>
  
  <p>How can it be done?</p>