title: Parameterized Discriminated Union in F#
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/12552759/typed-abstract-syntax-tree-with-function-application">Typed abstract syntax tree with function application</a>  </p>
  </blockquote>
  
  
  
  <p>I would like to have the following</p>
  
  <pre><code>type t&lt;'a&gt;=
    | Val of 'a
    | Apply of (('a -&gt; 'b) -&gt; t&lt;'a&gt; -&gt; t&lt;'b&gt;) * t&lt;'a&gt;
    | Apply2 of (('a -&gt; 'b -&gt; 'c) -&gt; t&lt;'a&gt; -&gt; t&lt;'b&gt; -&gt; t&lt;'c&gt;)* t&lt;'a&gt; * t&lt;'b&gt;
  </code></pre>
  
  <p>That is, <code>Apply</code> takes a function and a t, and applies f to the "content" of <code>t</code>.</p>
  
  <p>However it asks to have <code>t&lt;'a, 'b, 'c&gt;</code>, which means I then have to use three parameters for all <code>t&lt;_&gt;</code>. Is there a way to circumvent it?</p>
  
  <p>Many thanks for your insights</p>