论文标题
了解分解器光学:表示定理
Understanding Profunctor Optics: a representation theorem
论文作者
论文摘要
光学(又称功能参考)是允许合并访问复合数据结构的工具类别的类别。它们通常被定义为编程语言库,它们提供组合器来操纵各种数据,例如总和,产品和藏品,这些数据可以在较大的结构上进行操作。它们共同形成了一种强大的语言来描述数据的转换。在描述光学器件的不同方法中,一种特定类型的光学器件(称为profunctor光学器件)突出。它描述了大多数共同组合者的替代性但等效表示,并通过高阶编码通过优雅的合成性属性来增强它们。值得注意的是,它可以简单地跨不同的光学系列组成。不幸的是,划分光学很难理解,迄今为止,将常规光学器件与等效分配器表示已逐个措施进行,有时似乎非常适当。这使得很难分析现有的分解光学属性并定义新的属性。本文提出了分配光学的等效表示,称为同构光学,既接近直觉,又更容易推理。该工具使功能定理能够涉及分配光学器件的一般得出。最后,本论文开发了一个框架,以减轻从具体的光学系列中得出新的分配器编码。
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.