Post

I still mix up the terms "union" and "intersection" all the time no matter how much typescript I write

0 reposts28 likes

In TypeScript, intersection types merge the properties of multiple types. This is different from mathematical intersection, which only keeps common elements. So dont worry its not real. Real mathematicians dont get it either.

And to keep the analogy going. A TypeScript union type is precisely analogous to a categorical coproduct in the category of sets, which is implemented as a disjoint union.