News for hackers. Stuff that matters.
Re:Official proposal for Type Unions in C# by CharlieDigital on Wednesday August 07, 2024 @03:34PM (#41184570)
It's possible to add DUs in C# today with some third party packages.

- https://github.com/domn1995/dunet

- https://github.com/mcintyre321/OneOf

Quite good and ergonomic with the source generators removing a lot of the boilerplate.

I have a practical example here using OneOf with .NET Channels: https://chrlschn.dev/blog/2024/07/csharp-discriminated-union...

Re:Official proposal for Type Unions in C# by jeremycarter on Wednesday August 07, 2024 @05:42PM (#41185898)
Actually not a bad solution. Thanks for sharing