September 2023
Intermediate to advanced
470 pages
11h 12m
English
If we look at all the base door types, we can represent all our state changes as arrows starting and arriving at the same place:

What we have here is a diagram with only one type and a lot of arrows.
This is similar to the concept of monoid in category theory (see Appendix 3, A Pinch of Theory). More precisely, we can say that the door has a monoid instance. We won’t cover the theory here, but if you are interested, you can find more information in the appendix section Monoid. If we expand the state to all its substates, we can see how events are in relation with the possible states, like in the previous diagram.
Read now
Unlock full access