Calculating with lenses: optimising bidirectional transformations

  • Authors:
  • Hugo Pacheco;Alcino Cunha

  • Affiliations:
  • Universidade do Minho, Braga, Portugal;Universidade do Minho, Braga, Portugal

  • Venue:
  • Proceedings of the 20th ACM SIGPLAN workshop on Partial evaluation and program manipulation
  • Year:
  • 2011

Quantified Score

Hi-index 0.00

Visualization

Abstract

This paper presents an equational calculus to reason about bidirectional transformations specified in the point-free style. In particular, it focuses on the so-called lenses as a bidirectional idiom, and shows that many standard laws characterising point-free combinators and recursion patterns are also valid in that setting. A key result is that uniqueness also holds for bidirectional folds and unfolds, thus unleashing the power of fusion as a program optimisation technique. A rewriting system for automatic lens optimisation is also presented, to prove the usefulness of the proposed calculus.