You have probably heard of such phrase as “make illegal states unrepresentable” already. Basically, it stands for using some set of techniques for dealing with illegal states in your domain model.
In this post, we’ll look at how C# and F# allow us to handle them.