3 ms·
> Yes! The article says as much in both the introduction and the caveats at the end! My point in saying so in that statement wasn’t to focus on the unnecessary
by eyelidlessness 5y ago
> Yes! The article says as much in both the introduction and the caveats at the end!
My point in saying so in that statement wasn’t to focus on the unnecessary mutation! It was to focus on the perfectly legitimate use case for assertion types in attempting to address it.
All of the rest is a fair point, and I probably did lean too hard on the mutation point. My intent in taking it further wasn’t to belabor that point, but to show that the merge type is solvable.
In hindsight I should have kept the assertion signature and focused on the solution to `never` (and the resulting unwieldy type), because I think that could be genuinely useful for many people.
Also in hindsight, I should have taken the time to say that I have attempted the exact same solution to the same problem for a different stateful API (in my case, Node vm.*Module initialization states), and reached the same conclusions.
My intent wasn’t to criticize. Nor to dispute anything in the article other than doubting the legitimacy of the approach. Apologies for failing to communicate that effectively.
- chriskrycho 5y agoThanks for the clarification!