The author shares their journey of creating a board game and the need for communication in a critical phase of the game, leading to the creation of custom types like Quote and Msg. They explore the use of optics/lenses and the pattern of types-as-interfaces to design simple and composed code. The article emphasizes the layering of data, comparing it to network protocol design, and advocates for simplicity by stripping away less important variants. The author challenges the idea of making functions generic over different types, suggesting that treating them as distinct types may be more efficient.
https://two-wrongs.com/types-as-interfaces