concept event - source domain model in category system administration

This is an excerpt from Manning's book Functional and Reactive Domain Modeling.
Remember, you got similar compositionality with our domain service APIs in chapter 5. Do you recollect the technique you used? Yes! Free monads.[6] They’re ready to make a comeback in our implementation of event-sourced domain models. You’ll define commands as free monads over events so that you can combine commands monadically to build the algebra of our model behavior. You can learn all the details in the next section.
This section covers some of the implementation aspects of an event-sourced domain model using the domain of personal banking. We use some of the use cases from earlier chapters so that you can relate to the functionality and think in terms of persistence of those model elements using the paradigm of event sourcing. This is by no means a production-ready, event-sourced domain model implementation; we’ll simplify wherever we can. The idea is to give you some food for thought for a functional implementation and highlight some of the relevant issues that may arise.