arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1403.0749cs.PLmath.CT
收藏

自由应用函子

Free Applicative Functors

Paolo Capriotti, Ambrus Kaposi

摘要:

应用函子是单子的推广。两者都允许将有效的计算表达为纯语言,如Haskell。当计算的结构是先验固定的时,应用函子比单子更可取。这使得对应用值执行某些类型的静态分析成为可能。我们定义了一个自由应用函子的概念,证明了它满足适当的法律,并且该结构是左伴随到一个合适的健忘函子。我们展示了如何自由的应用函子可以用来实现嵌入式DSL,可以静态分析。

英文摘要:

Applicative functors are a generalisation of monads. Both allow the expression of effectful computations into an otherwise pure language, like Haskell. Applicative functors are to be preferred to monads when the structure of a computation is fixed a priori. That makes it possible to perform certain kinds of static analysis on applicative values. We define a notion of free applicative functor, prove that it satisfies the appropriate laws, and that the construction is left adjoint to a suitable forgetful functor. We show how free applicative functors can be used to implement embedded DSLs which can be statically analysed.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑