title: Typescript type for an array of functions that each transform the data
body: <p>Let's say I have an array of functions that I want to reduce. Each function takes the entry from the previous function and returns a modified data.</p>
  <p>For example:</p>
  <pre><code>const modifiers = [(req: TypeA) =&gt; TypeB, (req: TypeB) =&gt; TypeC, (req: TypeC) =&gt; TypeD];
  </code></pre>
  <p>Is there a way to set the type definition so it is dynamic and that it checks you are using the functions in correct order? i.e.</p>
  <pre><code>const funcA = (req: TypeA): TypeB =&gt; { ... };
  const funcB = (req: TypeB): TypeC =&gt; { ... };
  const funcC = (req: TypeC): TypeD =&gt; { ... };
  
  // this would be fine
  const arry = [funcA, funcB, funcC];
  
  // this is also fine
  const arry = [funcB, funcC];
  
  // but this is an error
  const arry = [funcB, funcC, funcA];
  </code></pre>