The "Designing with types" series

In this series, we’ll look at some of the ways we can use types as part of the design process. In particular, the thoughtful use of types can make a design more transparent and improve correctness at the same time.

This series will be focused on the “micro level” of design. That is, working at the lowest level of individual types and functions. Higher level design approaches, and the associated decisions about using functional or object-oriented style, will be discussed in another series.

Many of the suggestions are also feasable in C# or Java, but the lightweight nature of F# types means that it is much more likely that we will do this kind of refactoring.

Making design more transparent and improving correctness
Adding meaning to primitive types
Gaining deeper insight into the domain
Using state machines to ensure correctness
Adding more semantic information to a primitive type
Working with integers and dates safely
A before and after comparison