First Thoughts on C# 15 Unions
TL;DR: C# 15 finally has union types. They’re a welcome addition, but not quite the discriminated unions I’m used to in F#. Untagged unions offer some nice compositional advantages, but introduce surprising behaviour around null. And while C# has adopted some of the benefits of TypeScript’s approach, it misses out on one I’ve been wanting in F# for years.
After years of working in F#, I’ve recently moved to a C# team.
Read more