Understanding profunctor optics: a representation theorem (extended abstract)
Guillaume Boisseau · 2018
Profunctor optics are composable building blocks used to define bidirectional data accessors. They form a powerful language to describe transformations of data. Unfortunately, contrary to more familiar optics like put-get lenses, profunctor optics have a complex type that makes them difficult to reason about. Moreover, linking usual optics with an equivalent profunctor representation has so far been done on a case-by-case basis, with definitions that sometimes feel very ad hoc. This makes it hard both to analyse properties of existing profunctor optics and to define new ones. This extended abstract proposes a general form for profunctor optics, and presents an equivalent representation called existential optics that is closer to intuition. This representation enables easier understanding of how profunctor optics function and are combined, as well as easier definition of useful new such optics.