Coalgebraic Update Lenses

Abstract Lenses are mathematical structures used in the context of bidirectional transformations. In this paper, we introduce update lenses as a refinement of ordinary (asymmetric) lenses in which we distinguish between views and updates. In addition to the set of views, there is a monoid of updates and an action of the monoid on the set of views. Decoupling updates from views allows for other ways of changing the source than just merging a view into the source. We also consider a yet finer dependently typed version of update lenses. We give a number of characterizations of update lenses in terms of bialgebras and coalgebras, including analogs to O'Connor's coalgebraic and Johnson, Rosebrugh and Wood's algebraic characterizations of ordinary lenses. We consider conversion of views and updates, a tensor product of update lenses and composition of update lenses.

[1]  Bart Jacobs,et al.  Categorical Logic and Type Theory , 2001, Studies in logic and the foundations of mathematics.

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

[3]  Michael Johnson,et al.  Relating Algebraic and Coalgebraic Descriptions of Lenses , 2012, Electron. Commun. Eur. Assoc. Softw. Sci. Technol..

[4]  Martin Hofmann,et al.  Edit lenses , 2012, POPL '12.

[5]  Miki Tanaka,et al.  Pseudo-Distributive Laws and a Unified Framework for Variable Binding , 2004 .

[6]  Martin Hofmann,et al.  Symmetric lenses , 2011, POPL '11.

[7]  Michael Johnson,et al.  Delta Lenses and Opfibrations , 2013, Electron. Commun. Eur. Assoc. Softw. Sci. Technol..

[8]  John Power,et al.  Combining a monad and a comonad , 2002, Theor. Comput. Sci..

[9]  Tarmo Uustalu,et al.  Update Monads: Cointerpreting Directed Containers , 2013, TYPES.

[10]  Michael Johnson,et al.  Spans of lenses , 2014, EDBT/ICDT Workshops.

[11]  M. Barr,et al.  Toposes, Triples and Theories , 1984 .

[12]  Russell O'Connor Functor is to Lens as Applicative is to Biplate: Introducing Multiplate , 2011, ArXiv.

[13]  P. T. Johnstone,et al.  TOPOSES, TRIPLES AND THEORIES (Grundlehren der mathematischen Wissenschaften 278) , 1986 .

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

[15]  John Power,et al.  From Comodels to Coalgebras: State and Arrays , 2004, CMCS.

[16]  A. Mikhalev,et al.  Monoids, Acts and Categories: With Applications to Wreath Products and Graphs. A Handbook for Students and Researchers , 2011 .

[17]  Benjamin C. Pierce,et al.  Quotient lenses , 2008, ICFP.

[18]  Tarmo Uustalu,et al.  When is a container a comonad? , 2012, Log. Methods Comput. Sci..

[19]  Ulrich Knauer,et al.  Monoids, acts, and categories , 2000 .

[20]  Thorsten Altenkirch,et al.  Containers: Constructing strictly positive types , 2005, Theor. Comput. Sci..

[21]  Krzysztof Czarnecki,et al.  From State- to Delta-Based Bidirectional Model Transformations: the Asymmetric Case , 2011, J. Object Technol..

[22]  S. Eilenberg,et al.  Adjoint functors and triples , 1965 .