Internal lenses as functors and cofunctors

Bryce Clarke

Lenses may be characterised as objects in the category of algebras over a monad, however they are often understood instead as morphisms, which propagate updates between systems. Working internally to a category with pullbacks, we define lenses as simultaneously functors and cofunctors between categories. We show that lenses may be canonically represented as a particular commuting triangle of functors, and unify the classical state-based lenses with both c-lenses and d-lenses in this framework. This new treatment of lenses leads to considerable simplifications that are important in applications, including a clear interpretation of lens composition.

In John Baez and Bob Coecke: Proceedings Applied Category Theory 2019 (ACT 2019), University of Oxford, UK, 15-19 July 2019, Electronic Proceedings in Theoretical Computer Science 323, pp. 183–195.
Published: 15th September 2020.

ArXived at: http://dx.doi.org/10.4204/EPTCS.323.13 bibtex PDF
References in reconstructed bibtex, XML and HTML format (approximated).
Comments and questions to: eptcs@eptcs.org
For website issues: webmaster@eptcs.org