2014-07-13 01:04:16 +02:00
|
|
|
//// [inferentialTypingWithFunctionTypeZip.ts]
|
|
|
|
var pair: <T, S>(x: T) => (y: S) => { x: T; y: S; }
|
|
|
|
var zipWith: <T, S, U>(a: T[], b: S[], f: (x: T) => (y: S) => U) => U[];
|
|
|
|
var result = zipWith([1, 2], ['a', 'b'], pair);
|
|
|
|
var i = result[0].x; // number
|
|
|
|
|
|
|
|
//// [inferentialTypingWithFunctionTypeZip.js]
|
|
|
|
var pair;
|
|
|
|
var zipWith;
|
|
|
|
var result = zipWith([1, 2], ['a', 'b'], pair);
|
2014-08-15 23:32:08 +02:00
|
|
|
var i = result[0].x; // number
|