logoalt Hacker News

aryonoco • yesterday at 4:33 PM • 1 reply • view on HN

C# finally has Sum types.

Not quite discriminated unions, but close. With an exhaustive checker with switch statements.

Now if only it made creating unique types easy, so I wouldn’t have to use a library like VOgen, the language would be nearly as good as F#


Replies

Metasyntactic • yesterday at 7:47 PM

Hey there. C# language designer here. Working on that here: https://github.com/dotnet/csharplang/tree/main/proposals/dis...

You can start reading through it starting at: https://github.com/dotnet/csharplang/blob/main/proposals/dis...

Definitely want to move to get this in asap :)

➕ show 1 reply