title: Why is the infer keyword needed in Typescript?
body: <p>Why did the Typescript folks create the <code>infer</code> keyword?
  According to the <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html" rel="noreferrer">documents</a>, this is an example of how you would use it:</p>
  
  <pre><code>type ReturnType&lt;T&gt; = T extends (...args: any[]) =&gt; infer R ? R : any;
  </code></pre>
  
  <p>I don't understand why this is needed. Why can't it just be:</p>
  
  <pre><code>type ReturnType&lt;T&gt; = T extends (...args: any[]) =&gt; R ? R : any;
  </code></pre>
  
  <p>Why doesn't this work? Why is the <code>infer</code> keyword necessary ?</p>