title: Higher-kinded Types with C++
body: <p>This question is for the people who know both Haskell (or any other functional language that supports Higher-kinded Types) and C++...</p>
  
  <p>Is it possible to model higher kinded types using C++ templates? If yes, then how?</p>
  
  <p><strong>EDIT :</strong></p>
  
  <p>From <a href="http://www.blumenfeld-maso.com/2010/01/what-does-monad-mean-by-tony-morris/" rel="noreferrer">this</a> presentation by Tony Morris:</p>
  
  <p><strong>Higher-order Polymorphism :</strong></p>
  
  <ul>
  <li><p>Languages such as Java and C# have
  first-order polymorphism because they
  allow us to abstract on types. e.g.
  <code>List&lt;A&gt;</code> can have a <code>reverse</code> function
  that works on any element type (the
  <code>A</code>).</p></li>
  <li><p>More practical programming languages
  and type systems allow us to
  abstract on type constructors as
  well.</p></li>
  <li><p>This feature is called higher-order
  (or higher-kinded) polymorphism.</p></li>
  </ul>
  
  <p><strong>Example :</strong> </p>
  
  <p>Pseudo-Java with an invented notation for higher-order polymorphism</p>
  
  <pre><code>interface Transformer&lt;X, Y&gt; {
    Y transform(X x);
  }
  
  interface Monad&lt;M&gt; { // M :: * -&gt; *
    &lt;A&gt; M&lt;A&gt; pure(A a);
    &lt;A, B&gt; M&lt;B&gt; bind(Transformer&lt;A, M&lt;B&gt;&gt; t, M&lt;A&gt; a);
  }
  </code></pre>