# Reflections on Monadic Lenses

@article{AbouSaleh2016ReflectionsOM, title={Reflections on Monadic Lenses}, author={Faris Abou-Saleh and James Cheney and Jeremy Gibbons and James McKinna and Perdita Stevens}, journal={ArXiv}, year={2016}, volume={abs/1601.02484} }

Bidirectional transformations (bx) have primarily been modeled as pure functions, and do not account for the possibility of the side-effects that are available in most programming languages. Recently several formulations of bx that use monads to account for effects have been proposed, both among practitioners and in academic research. The combination of bx with effects turns out to be surprisingly subtle, leading to problems with some of these proposals and increasing the complexity of others…

## 16 Citations

### Towards Optic-Based Algebraic Theories: The Case of Lenses

- Computer ScienceTFP
- 2018

It is argued that optics can serve as a fruitful metaphor to design a rich catalogue of state-based algebraic theories, and focuses on the paradigmatic case of lenses, which shows how lenses can be generalised into an algebraic theory; how compositionality of thesegebraic theories can be founded on lens composition; and how to exploit the resulting abstractions in the modular design of data layers.

### 1 . 2 ( Co ) ends and Yoneda Reduction

- Mathematics
- 2018

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…

### Profunctor optics, a categorical update

- Computer ScienceArXiv
- 2020

This work generalizes a classic result by Pastro and Street on Tambara theory and uses it to describe mixed V-enriched profunctor optics and to endow them with V-category structure.

### Introduction to Bidirectional Transformations

- Computer ScienceBidirectional Transformations
- 2016

A brief introduction to the field is presented, to provide some common background to the remainder of this volume, which constitutes the lecture notes from the Summer School on Bidirectional Transformations, held in Oxford in July 2016.

### Composing Bidirectional Programs Monadically

- Computer ScienceESOP
- 2019

This work introduces a framework for composing bid Directional programs monadically, enabling bidirectional programming with familiar abstractions in functional languages such as Haskell.

### Profunctor optics and traversals

- MathematicsArXiv
- 2020

It is shown that a refinement of the notion of optic is required in order to model it faithfully in Haskell programming, and two different approaches to composition between profunctor optics of different families are given: using distributive laws between the monads defining them, and using coproducts of monads.

### Understanding Profunctor Optics: a representation theorem

- Computer ScienceArXiv
- 2020

This thesis presents an equivalent representation of profunctor optics, called isomorphism optics, that is both closer to intuition and easier to reason about, and enables powerful theorems to be derived generically about prof unctor optics.

### Synthesizing bijective lenses

- Computer ScienceProc. ACM Program. Lang.
- 2018

This work defines a new language of lenses designed specifically for synthesis of bijective string transformers, and proves that this new language is just as powerful as a more natural, compositional, and declarative language and the synthesis algorithm is sound and complete with respect to the new language.

### Composing Bidirectional Programs

- Computer Science
- 2019

This work introduces a framework for composing bid Directional programs monadically, enabling bidirectional programming with familiar abstractions in functional languages such as Haskell.

### String Diagrams for Optics

- Physics, EducationFSCD
- 2020

This work presents a calculus that works for all optics, not just lenses; this is done by embedding optics into their presheaf category, which naturally features string diagrams.

## References

SHOWING 1-10 OF 18 REFERENCES

### Symmetric lenses

- MathematicsPOPL '11
- 2011

It is shown how the methods of universal algebra can be applied to build iterator lenses for structured data such as lists and trees, yielding lenses for operations like mapping, filtering, and concatenation from first principles.

### Notions of Bidirectional Computation and Entangled State Monads

- Computer ScienceMPC
- 2015

This work builds on the mature theory of monadic encapsulation of effects in functional programming, develops the equational theory and important combinators for effectful bx, and provides a prototype implementation in Haskell along with several illustrative examples.

### Three Complementary Approaches to Bidirectional Programming

- Computer ScienceSSGIP
- 2010

This paper surveys three distinct approaches to bidirectional programming, and pays particular attention to use of complements, which are structures that represent the information discarded by the transformation in the forward direction.

### Spans of lenses

- PhysicsEDBT/ICDT Workshops
- 2014

These functors which exhibit a category whose arrows are spans of wellbehaved lenses as a retract of a categorywhose arrows are the corresponding symmetric lenses are related to the asymmetric lenses of Hofmann, Pierce and Wagner.

### Coalgebraic Aspects of Bidirectional Computation

- Computer ScienceBx@STAF
- 2015

It is shown that cbx support a notion of composition coherent with, but conceptually simpler than, the previous mbx definition, and coalgebraic bisimulation yields a natural notion of behavioural equivalence on cb x, which respects composition, and essentially includes symmetric lens equivalence as a special case.

### Combinators for bidirectional tree transformations: A linguistic approach to the view-update problem

- Computer ScienceTOPL
- 2007

A novel approach to the view-update problem for tree-structured data: a domain-specific programming language in which all expressions denote bidirectional transformations on trees that map a concrete tree into a simplified abstract view and a modified abstract view to a correspondingly modified concrete tree.

### Monad transformers and modular interpreters

- Computer SciencePOPL '95
- 1995

A fully modular interpreter based on monad transformers that incudes features missing from Steele's, Espinosa's, and Wadler's earlier efforts is designed and implemented in Gofer, whose constructor classes provide just the added power over Haskell's type classes to allow precise and convenient expression of the ideas.

### Combinators for bi-directional tree transformations: a linguistic approach to the view update problem

- Computer SciencePOPL '05
- 2005

We propose a novel approach to the well-known view update problem for the case of tree-structured data: a domain-specific programming language in which all expressions denote bi-directional…

### Comprehending monads

- Computer ScienceMathematical Structures in Computer Science
- 1992

It is shown how list comprehensions may be generalised to an arbitrary monad, and how the resulting programming feature can concisely express in a pure functional language some programs that manipulate state, handle exceptions, parse text, or invoke continuations.

### Bidirectional model transformations in QVT: semantic issues and open questions

- Computer ScienceMODELS'07
- 2007

It is shown that any transformation language sufficient to the needs of model-driven development would have to be able to express non-bijective transformations.