Provide Iso optics for Yoneda
This commit is contained in:
parent
6c46279ec7
commit
4be8bc5dfc
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue