I’m a bit surprised that you decided to introduce an identity type for your groups. Wouldn’t it be easier if you instead relied on the one(x) function to provide the identity element for your groups? If so, you wouldn’t have to define your own addition methods and all the problems in your original post disappear.
6 Likes