Functional Programming with TypeScript's Type System
1–10 of 46 posts
Re: Functional Programming with TypeScript's Type System
#2Re: Functional Programming with TypeScript's Type System
#3Re: Functional Programming with TypeScript's Type System
#4Re: Functional Programming with TypeScript's Type System
#5Re: Functional Programming with TypeScript's Type System
#6Re: Functional Programming with TypeScript's Type System
#7Re: Functional Programming with TypeScript's Type System
#8You have to define every possible count of generic arguments if you want to preserve their types. And if you go above that count your type system degrades. I think there’s also a maximum of 7 or so before it doesn’t work. Beyond that and the generic type widens.
For example, Lodash enumerating types for 2 to 7 generic items per function: https://github.com/DefinitelyTyped/DefinitelyTyped/blob/0452...
Admittedly I don’t understand the problem space well. I’ve just seen it happen to me and in others’ code. It might not actually be an issue, or is already fixed.
Re: Functional Programming with TypeScript's Type System
#9While no actual Turing machine’s tape is infinitely long, I found issues in TypeScript with how finite generics are. You have to define every possible count of generic arguments if you want to preserve their types. And if you go above that count your type system degrades. I think there’s also a maximum of 7 or so before it doesn’t work. Beyond that and the generic type widens. For example, Lodash enumerating types fo…