4 ms·
Union types are very rare (scala, typescript are the notable ones I can think of that implement it), most other languages only have sum types (which includes ja
by kaba0 3y ago
Union types are very rare (scala, typescript are the notable ones I can think of that implement it), most other languages only have sum types (which includes java as well, see sealed interface/classes), where you have to create each unique set of types you want to use separately, wrapping each option into a marker type basically.