By putting effort into building the right data structures for your project, the compiler can guarantee that certain invalid states can never occur.
What about taking this idea a step further? How can we leverage the type system not just to prevent invalid states, but also invalid functions? We'll look at techniques for achieving this, overcoming some obstacles, and improving the readability of our code in the process.