Provide Iso optics for Yoneda

This commit is contained in:
Kiana Sheibani 2023-03-07 22:32:10 -05:00
parent 6c46279ec7
commit 4be8bc5dfc
Signed by: toki
GPG key ID: 6CB106C25E86A9F7

View file

@ -45,6 +45,11 @@ export
yonedaEqv : Profunctor p => p a b <=> Yoneda p a b yonedaEqv : Profunctor p => p a b <=> Yoneda p a b
yonedaEqv = MkEquivalence propure proextract yonedaEqv = MkEquivalence propure proextract
export
yonedaIso : (Profunctor q, Profunctor r) => forall p. Profunctor p =>
p (q a b) (r a' b') -> p (Yoneda q a b) (Yoneda r a' b')
yonedaIso = dimap proextract propure
export export
Functor (Yoneda p a) where Functor (Yoneda p a) where
map = rmap map = rmap
@ -118,6 +123,11 @@ export
coyonedaEqv : Profunctor p => p a b <=> Coyoneda p a b coyonedaEqv : Profunctor p => p a b <=> Coyoneda p a b
coyonedaEqv = MkEquivalence propure proextract coyonedaEqv = MkEquivalence propure proextract
export
coyonedaIso : (Profunctor q, Profunctor r) => forall p. Profunctor p =>
p (q a b) (r a' b') -> p (Coyoneda q a b) (Coyoneda r a' b')
coyonedaIso = dimap proextract propure
export export
Functor (Coyoneda p a) where Functor (Coyoneda p a) where
map = rmap map = rmap