logoalt Hacker News

kccqzyyesterday at 9:26 PM0 repliesview on HN

Tagged unions are not union types. A union type is a supertype for any arbitrary collection of types, but a tagged union aka sum type is a single type with multiple data constructors, and does not require subtyping to be implemented.