“formalising a popular Haskell pattern in category theory:”
Profunctor Optics, a Categorical Update
用丰富范畴与 Tambara 理论推广 profunctor optics,覆盖混合光学
光学(optics)是对子字段访问、容器遍历等数据变换模式的双向访问器,profunctor 表示支持模块化组合。论文指出此前研究只限于非丰富、非混合的设定,而函数式语言更适合用丰富范畴描述,并发现文献中的一些结构其实是访问方向落在不同范畴里的混合光学。作者推广了 Pastro 与 Street 关于 Tambara 理论的经典结果,用它描述混合的 V-丰富 profunctor 光学并赋予 V-范畴结构,给出一些原创的光学族和推导(包括遍历的初等推导),最后讨论了 Haskell 实现。
HN 上的人把它当作把 Haskell 常用的 lens 模式形式化到范畴论里的出处,也有人引它的表格查阅较冷门的 optics,并用范畴论视角推广到其他容器。
学习路径
读这篇之前,按顺序读书架上的 3 篇 · 参考文献来自 OpenAlex,顺序和要点由 Claude Code 排出先建立幺半范畴的背景,再看光学在博弈论中的来源和范畴定义,最后读 profunctor 光学的推广。
- 1
介绍幺半范畴语言和各领域的对应,是读范畴论文章的背景。
读对称幺半范畴的基本概念与例子,不必深入物理部分。
- 2
- 3
- 4Profunctor Optics, a Categorical Update
目标论文:用丰富范畴和 Tambara 理论推广 profunctor 光学到混合情形。
读profunctor 表示与光学的对应,再看混合光学与丰富范畴的推广。
HN 书评
推荐在前,同类按时间 · 每篇最多保留 20 条,统计用全部提及“Page 10 of this paper has a table with references to some more exotic optics, though it's going to be hard to parse without some category theory: Profunctor Optics, a Categorical Update”
“Anyhow, the upshot of reframing this as a simple argument in Category Theory meant that, with the help of James Deikun, I was able go generalize the argument to other types of containers.”
- Profunctor Optics, a Categorical Update ↗colinprince · 2020-01-31 · 2 分