Add an equality function to the statemachine macro