title: Generating curried constructor functions from io-ts type definition
body: <p>How can I implement function <code>from</code> that satisfies condition below?</p>
  <pre class="lang-js prettyprint-override"><code>import * as t from 'io-ts';
  
  declare const from: &lt;P extends t.Props, T extends t.TypeC&lt;P&gt;, R = t.TypeOf&lt;T&gt;&gt;(
    _: T
  ) =&gt; { readonly [K in keyof R]: (_: Omit&lt;R, K&gt;) =&gt; (_: R[K]) =&gt; R };
  
  const Lorem = t.type({
    foo: t.string,
    bar: t.number,
    baz: t.boolean,
  });
  
  type Lorem = t.TypeOf&lt;typeof Lorem&gt;;
  
  const expectedLorem: Lorem = { foo: 'foo', bar: 42, baz: true };
  
  const LoremFrom = from(Lorem);
  expect(LoremFrom.foo({ bar: 42, baz: true })('foo')).toStrictEqual(expectedLorem);
  expect(LoremFrom.bar({ foo: 'foo', baz: true })(42)).toStrictEqual(expectedLorem);
  expect(LoremFrom.baz({ foo: 'foo', bar: 42 })(true)).toStrictEqual(expectedLorem);
  </code></pre>