News for hackers. Stuff that matters.
Re:Tagged Unions Are Overrated by mpartel on Friday February 19, 2021 @09:50AM (#26193732)
Scala and TypeScript have (partial) answers to this.

In your example, Scala 2 would let Int32 and Int64 inherit a trait that Str doesn't. TypeScript would let you write a union type Int32 | Int64 that doesn't include Str (or add ExtraValue), and I think Scala 3 will have something very similar.

There are no comments on this comment yet.