WeakFunctorA

This commit is contained in:
AF 2023-05-26 08:05:53 +00:00
parent c9d0801f88
commit 859f217902

View File

@ -41,6 +41,14 @@ pub trait WeakFunctor {
Self: 'a; Self: 'a;
} }
pub trait WeakFunctorA<'a>: 'a {
type Fa<A: 'a>: 'a;
}
impl<'a, T: 'a + WeakFunctor> WeakFunctorA<'a> for T {
type Fa<A: 'a> = T::F<'a, A>;
}
pub type Wrap<'a, A, T> = <T as WeakFunctor>::F<'a, A>; pub type Wrap<'a, A, T> = <T as WeakFunctor>::F<'a, A>;
/// Rust-specific implementation of [`Functor`], respecting `move` semantics. /// Rust-specific implementation of [`Functor`], respecting `move` semantics.