When programming it is easy to find yourself in unexpected or invalid states. Using your compiler and type system, you can make these invalid states irrepresentable and prevent you from entering them and stopping bugs at the compiler rather than detecting them in production.