- haskpy.typeclasses.semigroup.Commutative
Commutative¶
- class Commutative¶
Bases:
Semigroup
Semigroup following commutativity law
This typeclass doesn’t add any features nor methods. It only adds a test for the commutativity law.
Minimal complete definition:
append
For property tests:
sample_semigroup_type & sample_commutative_type
- __add__(other)¶
Append two monoids
Using
+
operator to append two monoid values seems natural because that’s what Python is doing by default because lists are concatenated with+
.
- append(x)¶
m -> m -> m