//! This file defines the algebra trait. //! //! If F is an endo-functor, then an F-algebra is a natural //! transformation from F to the identity functor. use super::functor::Functor; /// An algebra is a function from F(T) to T. /// /// This is a "trait alias". Since Rust does not support trait alias /// yet, we define an empty trait with an automatic implementation. pub trait Algebra>: FnMut(F) -> T {} impl, A: FnMut(F) -> T> Algebra for A {}