pub trait BoundedAdjunction<L, R, Context>{
// Required methods
fn left_adjunct<A, B, F>(ctx: &Context, a: A, f: F) -> R::Type<B>
where F: Fn(L::Type<A>) -> B,
A: Clone + Zero + Copy + PartialEq,
B: Clone;
fn right_adjunct<A, B, F>(ctx: &Context, la: L::Type<A>, f: F) -> B
where F: FnMut(A) -> R::Type<B>,
A: Clone + Zero,
B: Clone + Zero + Add<Output = B> + Mul<Output = B>;
fn unit<A>(ctx: &Context, a: A) -> R::Type<L::Type<A>>
where A: Clone + Zero + Copy + PartialEq;
fn counit<B>(ctx: &Context, lrb: L::Type<R::Type<B>>) -> B
where B: Clone + Zero + Add<Output = B> + Mul<Output = B>;
}Expand description
The BoundedAdjunction trait defines a pair of adjoint functors $L$ (Left) and $R$ (Right)
that require a runtime Context to operate.
This is useful when the functors depend on an environment (like a Metric, Shape, or Topology) that cannot be fully captured in the static type system.
Required Methods§
Sourcefn left_adjunct<A, B, F>(ctx: &Context, a: A, f: F) -> R::Type<B>
fn left_adjunct<A, B, F>(ctx: &Context, a: A, f: F) -> R::Type<B>
The Left Adjunct: $(L(A) \to B) \to (A \to R(B))$ Transforms a function on the “Left” structure to a function on the “Right” structure, using the provided context.
Sourcefn right_adjunct<A, B, F>(ctx: &Context, la: L::Type<A>, f: F) -> B
fn right_adjunct<A, B, F>(ctx: &Context, la: L::Type<A>, f: F) -> B
The Right Adjunct: $(A \to R(B)) \to (L(A) \to B)$ Transforms a function on the “Right” structure to a function on the “Left” structure, using the provided context.
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.