In CQRS applications, commands and events are modeled as separate types with no direct link to the domain model. That is a challenge for fans of statically typed languages. This talk shows how to model a domain as an algebraic data type whose operations are commands and events. It compares three approaches: type parameters, type projections, and path-dependent types, with the pros and cons of each.
Recorded at Scala Days Copenhagen 2017.