Semigroupoid

Trait Semigroupoid 

Source
pub trait Semigroupoid: Kind1L2T {
    // Required method
    fn compose<'a, ClonableFnBrand: 'a + ClonableFn, B, C, D>(
        f: Apply1L2T<'a, Self, C, D>,
    ) -> ApplyFn<'a, ClonableFnBrand, Apply1L2T<'a, Self, B, C>, Apply1L2T<'a, Self, B, D>>;
}
Expand description

A type class for semigroupoids.

A Semigroupoid is a set of objects and composable relationships (morphisms) between them.

§Laws

Semigroupoid instances must satisfy the associative law:

  • Associativity: compose(p)(compose(q)(r)) = compose(compose(p)(q))(r).

§Examples

Required Methods§

Source

fn compose<'a, ClonableFnBrand: 'a + ClonableFn, B, C, D>( f: Apply1L2T<'a, Self, C, D>, ) -> ApplyFn<'a, ClonableFnBrand, Apply1L2T<'a, Self, B, C>, Apply1L2T<'a, Self, B, D>>

Takes morphisms f and g and returns the morphism f . g (f composed with g).

§Type Signature

forall b c d. Semigroupoid a => a c d -> a b c -> a b d

§Parameters
  • f: A morphism of type a c d.
  • g: A morphism of type a b c.
§Returns

The morphism f composed with g of type a b d.

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§