A simple state machine representation of a traffic light from the xstate docs.