SharedFunctor for CompositionClass
This commit is contained in:
parent
eb1c8f0167
commit
9d0d9028a4
@ -145,3 +145,23 @@ impl<U: LocalFunctor + Functor, V: LocalFunctor> LocalFunctor for CompositionCla
|
|||||||
U::stuff::<_, T>(U::fmap(V::stuff::<_, T>, fa))
|
U::stuff::<_, T>(U::fmap(V::stuff::<_, T>, fa))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<U: SharedFunctor + Functor, V: SharedFunctor> SharedFunctor for CompositionClass<U, V> {
|
||||||
|
type Shared<'a, A: 'a + Clone> = U::Shared<'a, V::Shared<'a, A>>
|
||||||
|
where
|
||||||
|
Self: 'a;
|
||||||
|
|
||||||
|
fn share<'a, A: 'a + Clone>(fa: Self::F<'a, A>) -> Self::Shared<'a, A>
|
||||||
|
where
|
||||||
|
Self: 'a,
|
||||||
|
{
|
||||||
|
U::share(U::fmap(V::share, fa))
|
||||||
|
}
|
||||||
|
|
||||||
|
fn unshare<'a, A: 'a + Clone>(sa: Self::Shared<'a, A>) -> Self::F<'a, A>
|
||||||
|
where
|
||||||
|
Self: 'a,
|
||||||
|
{
|
||||||
|
U::fmap(V::unshare, U::unshare(sa))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user