What You Needa Know about Yoneda: Profunctor optics and the yoneda Lemma (Functional Pearl)

12Citations
Citations of this article
25Readers
Mendeley users who have this article in their library.

Abstract

Profunctor optics are a neat and composable representation of bidirectional data accessors, including lenses, and their dual, prisms. The profunctor representation exploits higher-order functions and higher-kinded type constructor classes, but the relationship between this and the familiar representation in terms of 'getter' and 'setter' functions is not at all obvious.We derive the profunctor representation from the concrete representation, making the relationship clear. It turns out to be a fairly direct application of the Yoneda Lemma, arguably the most important result in category theory. We hope this derivation aids understanding of the profunctor representation. Conversely, it might also serve to provide some insight into the Yoneda Lemma.

Cite

CITATION STYLE

APA

Boisseau, G., & Gibbons, J. (2018). What You Needa Know about Yoneda: Profunctor optics and the yoneda Lemma (Functional Pearl). Proceedings of the ACM on Programming Languages, 2(ICFP). https://doi.org/10.1145/3236779

Register to see more suggestions

Mendeley helps you to discover research relevant for your work.

Already have an account?

Save time finding and organizing research with Mendeley

Sign up for free