Discriminated union, or disjoint union, is a data structure used to hold a value that could take on several different, but fixed types.
[Note: This question had the original title "C (ish) style union in C#" but as Jeff's comment informed me, apparently …
c# type-safety discriminated-unionDoes Kotlin have anything like discriminated unions (sum types)? What would be the idiomatic Kotlin translation of this (F#): type …
kotlin algebraic-data-types discriminated-unionI've been working with C# for a while and trying to get more familiar with Java. So I'm trying to …
java c# kotlin discriminated-unionI'm trying to constrain the input of a generic to be one of several types. The closest notation I've found …
typescript generics discriminated-union