Expand description
A crate about monoids.
§Crate Features
This crate supports the following feature flags, none of which are enabled by default:
num-traits: Adds a dependency onnum_traitsto implementZeroforops::AdditiveandOneforops::Multiplicative.syn: Adds a dependency onsynto implementMonoidforOption<syn::Error>.graph-track-inconsistency: Adds edge-case inconsistency detection tohom::graph::Graph(seeGraph::input_mut), at the cost of possibly increasing its size.
§A note about equality
Some sections in the documentation use equality to state rules that must hold.
Strictly speaking, this would of course require the types in question to impl Eq.
However, since these requirements aren’t enforced anyway,
it is up to the library consumer’s discretion to ensure these on a “best effort” basis.
For example, you might want to consider f32 and f64 as monoids under addition or multiplication,
even tho they are very much non-associative in general, since they are approximately associative for “tame” inputs
(not too large and not too small).
Modules§
- from_
ops - Monoids constructed from existing operations.
- hom
- Monoid homomorphisms
- list
- The list monoid.
- ops
- Operational types that allow the use of the monoid operation as an operator.
Macros§
- impl_
all_ monoid_ hom - A helper macro that implements all lower tiers of
Hom*for you, so you don’t have to repeat yourself so much when implementingHomMut,Hom, orHomStatic.
Structs§
Traits§
- Monoid
- A monoid.
- Monoid
Borrowed - The
Borrowed version of aMonoid. - PreMonoid
Borrowed - A
Borrowof aMonoid.