论文标题

内部镜头作为函子和联合函数

Internal lenses as functors and cofunctors

论文作者

Clarke, Bryce

论文摘要

镜片可以被描述为单个代数类别中的对象,但是通常将它们理解为形态主义,这可以传播系统之间的更新。我们在内部工作的类别有回调,将镜头定义为类别之间的函子和联合函数。我们表明,在此框架中,镜头可以用法则表示为特定的通勤三角形,并用C镜头和D型镜头将经典的基于状态的镜头统一。这种新的镜头处理导致了相当大的简化,这些简化在应用中很重要,包括对晶状体组成的明确解释。

Lenses may be characterised as objects in the category of algebras over a monad, however they are often understood instead as morphisms, which propagate updates between systems. Working internally to a category with pullbacks, we define lenses as simultaneously functors and cofunctors between categories. We show that lenses may be canonically represented as a particular commuting triangle of functors, and unify the classical state-based lenses with both c-lenses and d-lenses in this framework. This new treatment of lenses leads to considerable simplifications that are important in applications, including a clear interpretation of lens composition.

扫码加入交流群

加入微信交流群

微信交流群二维码

扫码加入学术交流群,获取更多资源