作为函子和共同函子的内部透镜
Internal lenses as functors and cofunctors
摘要:
透镜可以被描述为单子上的代数范畴中的对象,然而它们通常被理解为态射,它在系统之间传播更新。内部工作的一个类别与回调,我们定义镜头同时函子和类别之间的cofunctors。我们表明,透镜可以表示为一个特定的函子的交换三角形,并统一了经典的基于状态的透镜与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.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。