Understanding Profunctor Optics: a representation theorem

01/27/2020
by   Guillaume Boisseau, et al.
0

Optics, aka functional references, are classes of tools that allow composable access into compound data structures. Usually defined as programming language libraries, they provide combinators to manipulate different shapes of data such as sums, products and collections, that can be composed to operate on larger structures. Together they form a powerful language to describe transformations of data. Among the different approaches to describing optics, one particular type of optics, called profunctor optics, stands out. It describes alternative but equivalent representations of most of the common combinators, and enhances them with elegant composability properties via a higher-order encoding. Notably, it enables easy composition across different optic families. Unfortunately, profunctor optics are difficult to reason about, and linking usual optics with an equivalent profunctor representation has so far been done on a case-by-case basis, with definitions that sometimes seem very ad hoc. This makes it hard both to analyse properties of existing profunctor optics and to define new ones. This thesis presents an equivalent representation of profunctor optics, called isomorphism optics, that is both closer to intuition and easier to reason about. This tool enables powerful theorems to be derived generically about profunctor optics. Finally, this thesis develops a framework to ease deriving new profunctor encodings from concrete optic families.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
01/22/2020

Profunctor optics and traversals

Optics are bidirectional accessors of data structures; they provide a po...
research
12/20/2022

Pragmatic isomorphism proofs between Coq representations: application to lambda-term families

There are several ways to formally represent families of data, such as l...
research
09/29/2020

Isomorphic Data Type Transformations

In stepwise derivations of programs from specifications, data type refin...
research
10/21/2019

Reasoning About Recursive Tree Traversals

Traversals are commonly seen in tree data structures, and performance-en...
research
06/07/2022

Automated Expected Amortised Cost Analysis of Probabilistic Data Structures

In this paper, we present the first fully-automated expected amortised c...
research
02/01/2019

Semantic Query Integration With Reason

Graph-based data models allow for flexible data representation. In parti...
research
01/10/2021

Tietze Equivalences as Weak Equivalences

A given monoid usually admits many presentations by generators and relat...

Please sign up or login with your details

Forgot password? Click here to reset