![Page 1: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/1.jpg)
![Page 2: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/2.jpg)
![Page 3: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/3.jpg)
![Page 4: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/4.jpg)
x 10,000
x 1,000,000
x 1000
![Page 5: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/5.jpg)
![Page 6: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/6.jpg)
Assembler
Procedural
Object
Oriented
Managed
![Page 7: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/7.jpg)
![Page 8: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/8.jpg)
![Page 9: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/9.jpg)
![Page 10: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/10.jpg)
λ
First class functions
Immutable
data
Referential
transparency
Algebraic data types
Type
inference
Pattern
matching
![Page 11: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/11.jpg)
![Page 12: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/12.jpg)
![Page 13: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/13.jpg)
![Page 14: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/14.jpg)
function sumOfSquares(a) {var result = 0;for (var i = 0; i < a.length; i++) {
result += a[i] * a[i];}return result;
}
![Page 15: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/15.jpg)
function sumOfSquares(a) {if (a.length === 0) {
return 0;}else {
return a[0] * a[0] + sumOfSquares(a.slice(1));}
}
![Page 16: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/16.jpg)
let rec sumOfSquares a =match a with| [] -> 0| h :: t -> h * h + sumOfSquares t
![Page 17: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/17.jpg)
function sumOfSquares(a) {return a.reduce((x, y) => x + y * y, 0);
}
![Page 18: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/18.jpg)
const products = getProductList();const maxPrice = 100;const result = products
.filter(p => p.price < maxPrice)
.map(p => p.name);
![Page 19: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/19.jpg)
![Page 20: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/20.jpg)
![Page 21: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/21.jpg)
![Page 22: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/22.jpg)
![Page 23: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/23.jpg)
![Page 24: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/24.jpg)
![Page 25: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/25.jpg)
![Page 26: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/26.jpg)
![Page 27: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/27.jpg)
ES7 (2016)
ES6 (2015)
ES5 (2009)
ES3 (1999)
![Page 28: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/28.jpg)
![Page 29: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/29.jpg)
![Page 30: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/30.jpg)
![Page 31: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/31.jpg)
![Page 32: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/32.jpg)
![Page 33: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/33.jpg)
![Page 34: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/34.jpg)
![Page 35: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/35.jpg)
![Page 36: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/36.jpg)
![Page 37: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/37.jpg)
![Page 38: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/38.jpg)
![Page 39: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/39.jpg)
var data = downloadData(...);processData(data);
downloadDataAsync(... , data => {processData(data);
});
downloadDataAsync processData
processDatadownloadData
![Page 40: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/40.jpg)
ThreadPool.run(() => {var data = downloadData(...);processData(data);
});
processDatadownloadData
![Page 41: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/41.jpg)
![Page 42: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/42.jpg)
function doWork(...) {return webService1(...).then(data1 => {
return webService2(...).then(data2 => {var result = doSomething(data1, data2);return result;
});});
}
![Page 43: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/43.jpg)
async function doWork(...) {var data1 = await webService1(...);var data2 = await webService2(...);var result = doSomething(data1, data2);return result;
}
![Page 44: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/44.jpg)
![Page 45: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/45.jpg)
![Page 46: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/46.jpg)
![Page 47: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/47.jpg)
CompilerCompilerSource code
Source code
Source
File
Source codeSource code
Executable
Code
Class
Field
public Foo
private
string
X
Statement completion Code navigation
Refactoring Outlining
![Page 48: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/48.jpg)
![Page 49: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/49.jpg)
![Page 50: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/50.jpg)
![Page 51: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/51.jpg)
JSON
![Page 52: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/52.jpg)
![Page 53: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/53.jpg)
![Page 54: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/54.jpg)
![Page 55: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/55.jpg)
![Page 56: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/56.jpg)
![Page 57: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/57.jpg)
![Page 58: TypeScript · λ First class functions Immutable data Referential transparency Algebraic data types Type inference Pattern matching](https://reader030.vdocuments.pub/reader030/viewer/2022040718/5e26f7499ee96e535c13d971/html5/thumbnails/58.jpg)