title: How do I express this in Typescript?
body: <p>Let's say I have an interface <code>A</code>:</p>
  
  <pre><code>interface A {
    foo: number
    bar: string
  }
  </code></pre>
  
  <p>And I have a generic type <code>Option</code>:</p>
  
  <pre><code>type Option&lt;T&gt; = {
    map: () =&gt; T
  }
  </code></pre>
  
  <p>Then I create a new interface <code>B</code> from <code>A</code> and <code>Option</code>:</p>
  
  <pre><code>interface B {
    foo: Option&lt;number&gt;
    bar: Option&lt;string&gt;
  }
  </code></pre>
  
  <p>How can I make this operation more general? Ie. The API I want is:</p>
  
  <pre><code>type B = Lift&lt;A&gt;
  </code></pre>
  
  <p>Where <code>Lift</code> automatically maps each member of <code>A</code> to an <code>Option</code>. Note that <code>A</code> can have any number of members, of any type.</p>
  
  <p>How can I implement <code>Lift</code>? If this is not possible in TypeScript, does anyone have a Scala/Haskell solution?</p>