You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These instances exist already as Codensity and Density but they could be included for right/left Kan extensions of functors along themselves.
instancef₁ ~f₂ =>Applicative (Ranf₁ f₂) wherepure x =Ran (\k -> k x)
Ran f <*>Ran g =Ran (\bfr -> f (\ab -> g (bfr . ab)))
instancef₁ ~f₂ =>Monad (Ranf₁ f₂) wherereturn=pure
m >>= k =Ran (\c -> runRan m (\a -> runRan (k a) c))
-- etc.
and
instancef₁ ~f₂ =>Comonad (Lanf₁ f₂) where
duplicate (Lan f ws) =Lan (Lan f) ws
extract (Lan f a) = f a
-- etc.
Annoyingly the same can be done for Yoneda / Coyoneda
instance (Identity~id, Applicativef) =>Applicative (Ranidf) wherepure a =Ran (\f ->pure (runIdentity (f a)))
-- ... instanceIdentity~id=>Foldable (Codensityid) wherefoldMap f =foldMap f . lowerYoneda . ranToYoneda . codensityToRan
which overlaps and looks icky, is this a horrible idea?
The text was updated successfully, but these errors were encountered:
These instances exist already as
Codensity
andDensity
but they could be included for right/left Kan extensions of functors along themselves.and
Annoyingly the same can be done for
Yoneda
/Coyoneda
which overlaps and looks icky, is this a horrible idea?
The text was updated successfully, but these errors were encountered: