3 ms·
Apparently C# 7 can match discriminated unions quite well[1], with the caveats being: 1. you need a dummy type[2] for empty parts of the union. 2. it still ca
by ben509 6y ago
Apparently C# 7 can match discriminated unions quite well[1], with the caveats being:
1. you need a dummy type[2] for empty parts of the union.
2. it still can't enforce exhaustive matching.
[1]: https://stu.dev/pattern-matching-fsharp-union-types-in-csharp/ https://stu.dev/pattern-matching-fsharp-union-types-in-cshar...
[2]: Maybe () would work?