title: Higher-order type functions in TypeScript?
body: <p>Please consider the following pseudo-code trying to define a higher-order type function with a function-typed parameter <code>M&lt;?&gt;</code>:</p>
  
  <pre class="lang-js prettyprint-override"><code>type HigherOrderTypeFn&lt;T, M&lt;?&gt;&gt; = T extends (...)
    ? M&lt;T&gt;
    : never;
  </code></pre>
  
  <p><code>M&lt;?&gt;</code> is syntactically incorrect TypeScript, but declaring the type signature as <code>HigherOrderTypeFn&lt;T, M&gt;</code> yields the error <code>Type 'M' is not generic. ts(2315)</code> on the second line.</p>
  
  <p>Am I correct assuming that such a type is currently unrepresentable in TS?</p>