3 ms·
For anyone who is disappointed at the lack of exhaustive matching / Discriminated Unions, please try out my library OneOf* (https://github.com/mcintyre321/OneOf
by macca321 10y ago
For anyone who is disappointed at the lack of exhaustive matching / Discriminated Unions, please try out my library OneOf* (https://github.com/mcintyre321/OneOf https://github.com/mcintyre321/OneOf). Hopefully something similar will be brought into C# soon, but in the meantime, these libraries provide fairly idiomatic substitutes.
Also, ValueUtils (https://www.nuget.org/packages/ValueUtils/ https://www.nuget.org/packages/ValueUtils/) is nice for making value types.
*or one of the many alternatives (https://www.nuget.org/packages?q=discriminated+unions https://www.nuget.org/packages?q=discriminated+unions) e.g. SuccincT, DiscU