Let your types speak for themselves

How to write TypeScript so that the shape of your code encodes the correctness of your program