amonoid 0.1.2

A general-purpose monoid library
Documentation
//! 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 on [`num_traits`]
//!   to implement [`Zero`] for [`ops::Additive`]
//!   and [`One`] for [`ops::Multiplicative`].
//! - `syn`: Adds a dependency on [`syn`] to implement [`Monoid`] for `Option<`[`syn::Error`]`>`.
//! - `graph-track-inconsistency`: Adds edge-case inconsistency detection
//!   to [`hom::graph::Graph`] (see [`Graph::input_mut`](hom::graph::Graph::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).
//!
#![cfg_attr(
	feature = "num-traits",
	doc = "[`Zero`]: num_traits::Zero
	[`One`]: num_traits::One"
)]
#![cfg_attr(
	not(feature = "num-traits"),
	doc = "[`num_traits`]: https://docs.rs/num_traits/0.2/num_traits
	[`Zero`]: https://docs.rs/num-traits/0.2/num_traits/identities/trait.Zero.html
	[`One`]: https://docs.rs/num-traits/0.2/num_traits/identities/trait.One.html"
)]
#![cfg_attr(
	not(feature = "syn"),
	doc = "[`syn`]: https://docs.rs/syn/>=1,<3/syn
	[`syn::Error`]: https://docs.rs/syn/>=1,<3/syn/struct.Error.html"
)]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![warn(missing_docs)]

pub use base::{Monoid, Opposite};
pub use borrowed::{MonoidBorrowed, PreMonoidBorrowed};

mod base;
mod borrowed;
pub mod hom;
pub mod ops;
pub mod from_ops;
pub mod list;

#[cfg(doctest)]
#[doc = include_str!("../README.md")]
mod doctest_reamde {}