4 ms·
"+" is probably a bad choice: sum types are a separate thing. In TypeScript, they can be implemented as Sum<X, Y> = { tag: "left", data: X } | { tag: "rig
by hither_shores 5y ago
"+" is probably a bad choice: sum types are a separate thing. In TypeScript, they can be implemented as
Sum<X, Y> = { tag: "left", data: X } | { tag: "right", data: Y }
Generally higher order types are named according to what they do to types, not terms. `x: ICat & IDog` means "x is in the intersection of ICat and IDog", not "x is the intersection of an ICat and an IDog". (The latter interpretation only even makes sense for record types and a few other special cases: what's the intersection of an integer and a string supposed to be?)