types as sets

A way of thinking about types as sets of possible values, so unions are combined sets and intersections are overlaps.

In more detail

string is the set of all strings, "GET" is a set with one member, unknown is the set of everything and never is the empty set. This view explains why an intersection of string and number is never, since no value is in both sets.

Related terms

Taught in

References