diff --git a/src/func/classes/composition.rs b/src/func/classes/composition.rs index 8ae9645..7a7c5ca 100644 --- a/src/func/classes/composition.rs +++ b/src/func/classes/composition.rs @@ -145,3 +145,23 @@ impl LocalFunctor for CompositionCla U::stuff::<_, T>(U::fmap(V::stuff::<_, T>, fa)) } } + +impl SharedFunctor for CompositionClass { + 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)) + } +}