Yoneda - Category Theory

Welcome to the Functional Programming Zulip Chat Archive. You can join the chat here.

TheMatten

Trying to get intuition on Yoneda Lemma - is this proper specialization to Hask?:

newtype f ~> g = Nat{ ($~) :: forall x. f x -> g x }
data a <-> b = Iso{ from :: a -> b, to :: b -> a }

yoneda :: Functor f => ((->) a ~> f) <-> f a
yoneda = Iso ($~ id) (\fa -> Nat (<$> fa))