|
|
|
|
|
by dragonwriter
591 days ago
|
|
> Sure, but ten years ago, if I told you the concept of a “bottom type” would be common knowledge with web developers or they’d consider type algebra second nature, you’d have laughed at me. If you told me that was the case today with web developers generally, I’d laugh at you even harder than I would have if you made that prediction ten years ago. |
|
Similarly, a function that accepts (explicitly) `A | B | (C & D)` and then dispatches to functions that accept `A | (C&D)` vs `B` is, you guessed it, type algebra and is a common pattern in hot paths through every TS codebase.
Just because the formal nomenclature is unknown does not mean the concepts are unfamiliar.