- haskpy.typeclasses.monoid.Monoid
Monoid¶
- class Monoid¶
Bases:
Semigroup
Monoid typeclass
Minimal complete definition:
empty & append
For property tests:
sample_monoid_type & sample_semigroup_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
- property empty¶
Identity element for the monoid