Categories of Optics

Bidirectional data accessors such as lenses, prisms and traversals are all instances of the same general 'optic' construction. We give a careful account of this construction and show that it extends to a functor from the category of symmetric monoidal categories to itself. We also show that this construction enjoys a universal property: it freely adds counit morphisms to a symmetric monoidal category. Missing in the folklore is a general definition of 'lawfulness' that applies directly to any optic category. We provide such a definition and show that it is equivalent to the folklore profunctor optic laws.

[1]  de Paiva,et al.  The Dialectica categories , 1991 .

[2]  Eugenio Moggi,et al.  Notions of Computation and Monads , 1991, Inf. Comput..

[3]  A. Kock Strong functors and monoidal monads , 1972 .

[4]  Benjamin C. Pierce,et al.  Combinators for bi-directional tree transformations: a linguistic approach to the view update problem , 2005, POPL '05.

[5]  Michael Johnson,et al.  Algebras and Update Strategies , 2010, J. Univers. Comput. Sci..

[6]  Eugenio Moggi,et al.  Monad transformers as monoid transformers , 2010, Theor. Comput. Sci..

[7]  Michael Johnson,et al.  Relating Algebraic and Coalgebraic Descriptions of Lenses , 2012 .

[8]  Nicolas Wu,et al.  Profunctor Optics: Modular Data Accessors , 2017, Art Sci. Eng. Program..

[9]  G. M. Kelly,et al.  A note on actions of a monoidal category. , 2001 .

[10]  Zhenjiang Hu,et al.  A Clear Picture of Lens Laws - Functional Pearl , 2015, MPC.

[11]  Neil Ghani,et al.  Compositional Game Theory , 2016, LICS.

[12]  R. Street,et al.  Doubles for monoidal categories , 2007, 0711.1859.

[13]  Edmund Robinson,et al.  Premonoidal categories and notions of computation , 1997, Mathematical Structures in Computer Science.

[14]  Ross Street,et al.  Traced monoidal categories , 1996 .

[15]  Jeremy Gibbons,et al.  What you needa know about Yoneda: profunctor optics and the Yoneda lemma (functional pearl) , 2018, Proc. ACM Program. Lang..

[16]  Russell O'Connor,et al.  A representation theorem for second-order functionals , 2015, J. Funct. Program..