Design-by-Contract vs Type-driven Constraints

Validating that data fits certain constraints is a prevelant programming task and how we approach it effects the system’s safety and reliability. Many approaches have been devised, and I recently realized the key difference between two major approaches: Design-by-Contract and Type-Driven Development.

April 7, 2023 · 4 min

Constrained Types without Exceptions

Representing constrained values with types greatly reduces defensive programming. However, constraints make some values invalid, and constructors don’t allow for flexible return types like a failure state. Here’s an approach to constructing constrained values without relying on exceptions.

July 8, 2022 · 3 min

Quantifying Communication From Customer to Code

Learning functional programming has included significant quality time with Type-Driven Development and property-based testing. These paradigms highlighted a gap in my previous testing techniques. It led me to better classify types of communication errors between customers and code, and the toolset for addressing each type.

March 19, 2021 · 5 min