4 ms·
I find doing things like having types that flow through different stages -> UnvalidatedEmail, ValidatedEmail, VerifiedEmail is a lot better in f#. In c# you ne
by UK-AL 7y ago
I find doing things like having types that flow through different stages -> UnvalidatedEmail, ValidatedEmail, VerifiedEmail is a lot better in f#.
In c# you need to create a lot of value object classes for that. Or have some kind of property inside the value object which indicates current state of the email.
Even then you won't be able to exhaustive pattern matching on it to guarantee each situation is handled.
- Flow 7y agoMaybe I'm missing something, but what stops you from having Unvalidated<T> etc wrapper classes in C#?