Subclass of Num where (*) is commutative.
Num doesn't demand commutative (*), and there are reasonable
"real-world" instances with non-commutative multiplication. There
is also no canonical subclass in base that would suffice, as both
Integral and Floating imply commutative (*) for different
reasons.
Two examples of non-commutative (*):
Linear.Quaternion.Quaterionfrom thelinearpackage has a Num instance, and quaternion multiplication is noncommutative.Data.Matrix.Matrixfrom thematrixpackage uses(*)for matrix multiplication, which is also non-commutative (on square matrices, which is the only time the question makes sense).
Instances26CommutativeProduct, …
CommutativeProduct IntegerDefined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct NaturalDefined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct Int16Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct Int32Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct Int64Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct Int8Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct Word16Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct Word32Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct Word64Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct Word8Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct DoubleDefined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct FloatDefined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct IntDefined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct WordDefined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct a => CommutativeProduct (Max a)Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct a => CommutativeProduct (Min a)Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct a => CommutativeProduct (Identity a)Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct a => CommutativeProduct (Down a)Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct a => CommutativeProduct (Product a)Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct a => CommutativeProduct (Sum a)Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.Commutative(RealFloat a, CommutativeProduct a) => CommutativeProduct (Complex a)Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.Commutative(Integral a, CommutativeProduct a) => CommutativeProduct (Ratio a)Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct a => CommutativeProduct (Op a b)Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.Commutative(HasResolution a, CommutativeProduct a) => CommutativeProduct (Fixed a)Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct (f a) => CommutativeProduct (Alt f a)Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.CommutativeCommutativeProduct a => CommutativeProduct (Const a b)Defined in commutative-semigroups-0.2.0.1 · Numeric.Product.Commutative