BoundedComonad

Trait BoundedComonad 

Source
pub trait BoundedComonad<F: HKT>: Functor<F> {
    // Required methods
    fn extract<A>(fa: &F::Type<A>) -> A
       where A: Clone;
    fn extend<A, B, Func>(fa: &F::Type<A>, f: Func) -> F::Type<B>
       where Func: FnMut(&F::Type<A>) -> B,
             A: Zero + Copy + Clone,
             B: Zero + Copy + Clone;
}
Expand description

A Comonad that requires its contents to satisfy algebraic bounds. Essential for structures like MultiVectors that need a ‘Zero’ to represent a Physical Field Operator.

Required Methods§

Source

fn extract<A>(fa: &F::Type<A>) -> A
where A: Clone,

Source

fn extend<A, B, Func>(fa: &F::Type<A>, f: Func) -> F::Type<B>
where Func: FnMut(&F::Type<A>) -> B, A: Zero + Copy + Clone, B: Zero + Copy + Clone,

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§