←back to thread

201 points olvy0 | 1 comments | | HN request time: 0s | source
Show context
DeathArrow ◴[] No.41879035[source]
The more C# borrows from F#, the happier I am. I am awaiting for discriminated unions to finally reach C# so I can do domain modelling like a boss. :)
replies(4): >>41879289 #>>41880258 #>>41885677 #>>41903512 #
1. CharlieDigital ◴[] No.41879289[source]
You can largely already pretty easily incorporate DUs using OneOf[0] and Dunet[1].

A practical example of using this: https://chrlschn.dev/blog/2024/07/csharp-discriminated-union...

[0] https://github.com/mcintyre321/OneOf

[1] https://github.com/domn1995/dunet