Discriminated Unions

I thought this looked too interesting not to mention to everyone …

.Net meetup in Perth (… I have never been)

Tuesday, 20 February, 2024 at 5:30 pm. Held at the Microsoft offices in Perth.
Not online afaik … although I could enquire if anyone is keen.

Michael Crook - Discriminating Unions

Hosted By
Aaron H.

Michael Crook - Discriminating Unions



Welcome to 2024 :wave:, We are hoping to do better this year and catch up with everyone on the regular. Kicking of in February is Michael Crook talking about discriminating Unions :face_with_monocle:.

Over the last few releases of C# more and more functional paradigms have made their way into the language. We are now able to easily work with immutable data via records which avoid entire classes of bug types through immutable guarantees. Following down the functional path, we also got pattern matching and most critically, pattern matching with switch expressions. All of these changes that the language has seen over the last few years have been growing to a point of critical mass in which all that is needed is a final push for a fundamental re-working on how every day C# is written.

I believe that Discriminating Unions is the final piece to this equation and when it becomes a part of the language, an entirely new way of writing API’s and consuming them will take over the industry. With this one feature we will finally be able to rid ourselves of code that compiles but fails due to unhandled edge cases and start to write truly reliable code. In this talk I will highlight how recent additions to the language have enabled safer, more elegant code to be written, but also their limitations and why maybe you are yet to see any of your team working on them.

Next we will do a deep dive into a currently in progress feature: Discriminating Unions: What are they? What is the syntax going to look like? Finally, how can we use all of these together. The future is bright and it has a lot of hidden Exceptions being thrown!

Hope to see everyone there :fist_right: