4 ms·
I'm a somewhat comfortable TS user. Are you saying ternary chains using sentinels for arity inference is pretty common? I would disagree. > since it’s the mai
by jeswin 11mo ago
I'm a somewhat comfortable TS user.
Are you saying ternary chains using sentinels for arity inference is pretty common? I would disagree.
> since it’s the main control flow
Perhaps you're saying ternery chains are common in TS code? That's a very different thing though - the code above is not for runtime behavior.
- nawgz 11mo agoFor instance if you wrote a type to extend number to something like range<min,max> - obviously a toy - it would look very similar to what you’ve posted. So I’m struggling to see what the insight from the LLM is. Anytime one needs to iterate in TS, arity or otherwise, that is the technique to use…
- jeswin 11mo ago> For instance if you wrote a type to extend number to something like range<min,max> - obviously a toy - it would look very similar to what you’ve posted. Why would Range need a sentinel? My point is that using a sentinel to bridge TypeScript's lack of generic arity-based specialization is a non-trivial problem. After you mentioned it, I looked for examples on Google and couldn't find anything that matches precisely. I'm not claiming humans can't solve this, or that gpt5 invented something fundamentally new. My original point was about productivity at scale. Having a model apply the right solution across dozens of similar problems, rather than me manually figuring out each one.
- nawgz 11mo agoWhat is a sentinel?