3 ms·
I suppose this is orthogonal to compile time types, but I had to write my own utility to support PFA "decoration" of functions. It of course knows nothing abou
by Roboprog 10y ago
I suppose this is orthogonal to compile time types, but I had to write my own utility to support PFA "decoration" of functions. It of course knows nothing about the number or type of arguments in the original function. (I usually write JSDoc comments about resulting intermediate functions if they leave the nest)
For TS to do this, the compiler would need to supply the "apply"/"bind" feature and track that a function goes in, and the list of argument types, so it can check what is applied and track the types of any remaining arguments. Doable, but if it's not built into the compiler, I have to start running a transpile process that buys very little for much of my code.