Representing monads

Representing monads
复制标题

代表单子

DOI:
10.1145/174675.178047
复制
发表时间:
1994
期刊:
SSRN Electronic Journal
影响因子:
--
通讯作者:
Andrzej Filinski
Andrzej Filinski
中科院分区:
--
文献类型:
--
作者:
Andrzej Filinski

文献摘要

被引文献

相似文献

我们表明,任何单位和扩展操作都可以表达为纯粹的功能术语,可以将其嵌入使用“合成连续性”的逐个呼叫语言中。 - 通过延续的“持续性”风格与一般的“ monadic”风格,我们进一步表明,可以使用普通的,不可兼容的一流的延续和单个状态来代表合并的构造,在存在两个特定的计算效应的情况下 - 存储和逃逸 - 可以添加任何表达的单调结构(例如,列表单元代表的非确定性)作为纯定义的扩展,而无需重新解释整个语言该建筑的实施(在标准ML具有一些新泽西州扩展名)和几个示例。
We show that any monad whose unit and extension operations are expressible as purely functional terms can be embedded in a call-by-value language with “composable continuations”. As part of the development, we extend Meyer and Wand's characterization of the relationship between continuation-passing and direct style to one for continuation-passing vs. general “monadic” style. We further show that the composable-continuations construct can itself be represented using ordinary, non-composable first-class continuations and a single piece of state. Thus, in the presence of two specific computational effects - storage and escapes - any expressible monadic structure (e.g., nondeterminism as represented by the list monad) can be added as a purely definitional extension, without requiring a reinterpretation of the whole language. The paper includes an implementation of the construction (in Standard ML with some New Jersey extensions) and several examples.