3 ms·
I believe this is what the author is referring to at the end: >Unfortunately, the lack of discriminated unions and pattern matching makes the F#’s approach mos
by drabiega 11y ago
I believe this is what the author is referring to at the end:
>Unfortunately, the lack of discriminated unions and pattern matching makes the F#’s approach mostly unbearable to implement in C#. It’s possible in some simple cases but still remains pretty tedious.
- inglor 11y agoGood point. No, I don't believe that's what they mean there. The OP defines the F# version user as a union of either an activeuser or a deleteduser. The C# idiomatic way would be to use an abstract class and implement two subclasses. The difference is that in the C# way someone could in theory (if they're your evil wizard arch nemesis for example) create a third user subclass and harm the type soundness. In practice you can guard against that as well if you really have to guard against evil wizards.