Profunctor光学:范畴论更新
Profunctor Optics, a Categorical Update
AI总结:
本文将Profunctor光学推广到混合V-充实范畴环境,基于Pastro-Street的Tambara理论赋予其V-范畴结构,并提出新的光学族与遍历推导及Haskell实现。
摘要:
光学(Optics)是双向数据访问器,能够刻画诸如访问子字段或遍历容器等数据转换模式。Profunctor光学是一种特定的表示选择,支持模块化,这意味着我们可以通过组合更简单的访问器来构造复杂结构的访问器。此前,Profunctor光学仅在非充实且非混合的环境中被研究,其中两个访问方向都在同一个范畴中建模。然而,函数式编程语言更适合用充实范畴来描述;并且我们发现文献中的一些结构实际上是混合光学,其访问方向在不同的范畴中建模。我们的工作推广了Pastro和Street关于Tambara理论的经典结果,并利用它来描述混合的V-充实Profunctor光学,并赋予它们V-范畴结构。我们提供了一些原创的光学族和推导,包括一个用于遍历(traversals)的初等推导。最后,我们讨论了一个Haskell实现。
英文摘要:
Optics are bidirectional data accessors that capture data transformation patterns such as accessing subfields or iterating over containers. Profunctor optics are a particular choice of representation supporting modularity, meaning that we can construct accessors for complex structures by combining simpler ones. Profunctor optics have previously been studied only in an unenriched and non-mixed setting, in which both directions of access are modelled in the same category. However, functional programming languages are arguably better described by enriched categories; and we have found that some structures in the literature are actually mixed optics, with access directions modelled in different categories. Our 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. We provide some original families of optics and derivations, including an elementary one for traversals. Finally, we discuss a Haskell implementation.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。