//! This file defines the co-algebra trait. //! //! If F is an endo-functor, then an F-co-algebra is a natural //! transformation from the identity functor to F. use super::functor::Functor; /// A co-algebra is a function from T to F(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 Coalgebra>: FnMut(T) -> F {} impl, C: FnMut(T) -> F> Coalgebra for C {}