algebra
algebra copied to clipboard
Z-modules must be abelian
A group is only a Z-module when the group is abelian, as you need (x*y)^2 == x^2 * y^2. However, ZeroRng has instance Group r => LeftModule Integer (ZeroRng r). The context should also require Abelian r. Similarly with the LeftModule Natural (ZeroRng r) declaration, and with RightModule.
It might be beneficial to add Abelian m to the requirements of LeftModule, as normally modules are required to have abelian addition. However, that isn't strictly speaking implied by the module axioms unless r is unital.