5 ms·
Type sum is more like XOR though, in that it excludes overlap. I think of | for types as a set-like union type, with overlap allowed. At least that's how Typesc
by andrewflnr 1y ago
Type sum is more like XOR though, in that it excludes overlap. I think of | for types as a set-like union type, with overlap allowed. At least that's how Typescript uses that operator (which makes sense for modeling JS APIs, but does not bring the joy of algebraic sums).