So far, we've learned the basics of Reason. We've seen how having a sound type system can make refactoring a safer, less stressful endeavor. When changing an implementation detail, the type system helpfully alerts us to the other areas of the codebase that need to be updated. In this chapter, we'll learn how to hide implementation details to make refactoring even easier. By hiding implementation details, we guarantee that changing them won't affect other areas of your codebase.
We'll also learn how the type system can help us enforce business rules in our application. Hiding implementation details also gives us a nice way to enforce business rules by guaranteeing that modules are not being misused by the user. We'll illustrate this point throughout much of this chapter using simple code examples that are included in this book's GitHub...