3 ms·
It's not just you. To learn how to express more advanced types (or learn whether they are even possible to express), I've had to Google, read source code, or sc
by DangitBobby 4y ago
It's not just you. To learn how to express more advanced types (or learn whether they are even possible to express), I've had to Google, read source code, or scan random medium articles and blogs from tech companies. Rarely have I learned anything new from the TS docs.
- nkrisc 4y agoI learned more from this type definition than anything I’ve ever read about TypeScript’s type system before: interface add extends F { out: this['args'] extends [infer a, infer b] ? a extends Zero ? b : a extends Suc<infer n> ? Suc<apply<add, [n, b]>> : never : never }