paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Selective applicative functors

选择性应用函子
ICFP 3(ICFP)2019匹配度 2/10 · 该论文属于函数式编程语言设计,提出选择性应用函子这一效果抽象,与用户核心关注的静态分析、LLM/Agent、浮点程序分析或贝叶斯程序分析均无直接关系。仅在“效果静态声明与动态选择”层面可能与程序分析中的效果推理存在极弱的间接联系。引用 14 inbox
Andrey Mokhov, Georgy Lukyanov, Simon Marlow, Jeremie Dimino
crossref: 2026-09-10

AI 速览

一句话:提出选择性应用函子,介于应用函子与单子之间,可静态声明效果并动态选择执行。

应用函子与单子广泛用于函数式编程中描述带效果的计算:前者组合相互独立、静态声明的效果,后者允许后续效果依赖先前计算值而动态组合。本文引入选择性应用函子(selective applicative functors)这一中间抽象:所有效果仍需静态声明,但可以在运行时动态选择执行其中哪些效果。文章给出该抽象的理论接口与若干示例,并展示两个工业案例研究,说明其能表达比应用函子更灵活、又比单子更受限且可分析的效果组合。

问题
如何在保持效果静态声明的同时,支持运行时选择执行哪些效果,以填补应用函子和单子之间的表达力鸿沟。
方法
引入 selective applicative functors 抽象,定义其接口,并通过多个示例和两个工业案例研究展示其用法。
评估
通过若干示例与两个工业案例研究进行论证和展示,说明该抽象在实践中的适用性。
原文摘要(Abstract)

Applicative functors and monads have conquered the world of functional programming by providing general and powerful ways of describing effectful computations using pure functions. Applicative functors provide a way to compose independent effects that cannot depend on values produced by earlier computations, and all of which are declared statically. Monads extend the applicative interface by making it possible to compose dependent effects, where the value computed by one effect determines all subsequent effects, dynamically. This paper introduces an intermediate abstraction called selective applicative functors that requires all effects to be declared statically, but provides a way to select which of the effects to execute dynamically. We demonstrate applications of the new abstraction on several examples, including two industrial case studies.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot598,
  title = {Selective applicative functors},
  author = {Andrey Mokhov and Georgy Lukyanov and Simon Marlow and Jeremie Dimino},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {3},
  number = {ICFP},
  year = {2019},
  doi = {10.1145/3341694}
}