3 ms·
Good 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# idi
by inglor 11y ago
Good 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.