HNHacker News
TopNewBestAskShowJobs

jasdfasd

3 karma · joined November 1, 2024

submissionscomments
jasdfasd··on Sets, types and type checking
disjoint union vs union.

Scala3 is the only programming language to implement both AFAIK.

C# has a proposal to add both unions and disjoint unions: https://github.com/dotnet/csharplang/blob/main/proposals/Typ...

OCaml has polymorphic variants which are open disjoint unions.

Kotlin is looking to add union types for errors: https://youtrack.jetbrains.com/issue/KT-68296/Union-Types-fo...

I believe Java's checked exceptions behave somewhat like union types.