Category

Trait Category 

Source
pub trait Category: Semigroupoid {
    // Required method
    fn identity<'a, A: 'a>() -> Apply1L2T<'a, Self, A, A>;
}
Expand description

A type class for categories.

Category extends Semigroupoid with an identity element.

§Laws

Category instances must satisfy the identity law:

  • Identity: compose(identity)(p) = compose(p)(identity).

Required Methods§

Source

fn identity<'a, A: 'a>() -> Apply1L2T<'a, Self, A, A>

Returns the identity morphism.

§Type Signature

forall a. Category c => () -> c a a

§Returns

The identity morphism.

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§