【24h】

Monads in Action

机译:在行动中的金属人

获取原文

摘要

In functional programming, monadic characterizations of computational effects are normally understood denotationally: they describe how an effectful program can be systematically expanded or translated into a larger, pure program, which can then be evaluated according to an effect-free semantics. Any effect-specific operations expressible in the monad are also given purely functional definitions, but these definitions are only directly executable in the context of an already translated program. This approach thus takes an inherently Church-style view of effects: the nominal meaning of every effectful term in the program depends crucially on its type. We present here a complementary, operational view of monadic effects, in which an effect definition directly induces an imperative behavior of the new operations expressible in the monad. This behavior is formalized as additional operational rules for only the new constructs; it does not require any structural changes to the evaluation judgment. Specifically, we give a small-step operational semantics of a prototypical functional language supporting programmer-definable, layered effects, and show how this semantics naturally supports reasoning by familiar syntactic techniques, such as showing soundness of a Curry-style effect-type system by the progress+preservation method.
机译:在功能规划中,通常会理解计算效果的Monadic表征:它们描述了如何将有效的程序系统地扩展或转换成更大的纯程序,然后可以根据无效应的语义进行评估。 MONAD中表达的任何特定于特定的操作也被授予纯粹的功能定义,但这些定义仅在已翻译的程序的上下文中直接可执行。因此,这种方法采用了一个固有的教堂风格的效果视图:程序中每种有效项的标称含义都依赖于其类型。我们在这里展示了一个补充,操作看法的Monadic效果,其中效果定义直接诱导了Monad中表达的新操作的必要行为。这种行为是仅为新建筑的额外运营规则正式化;它不需要对评估判断的任何结构性变化。具体而言,我们提供了一种支持程序员可定义,分层效果的原型功能语言的小型操作语义,并展示了该语义如何通过熟悉的句法技术自然地支持推理,例如展示咖喱式效果型系统的合理性进度+保存方法。

著录项

相似文献

  • 外文文献
  • 中文文献
  • 专利
获取原文

客服邮箱:kefu@zhangqiaokeyan.com

京公网安备:11010802029741号 ICP备案号:京ICP备15016152号-6 六维联合信息科技 (北京) 有限公司©版权所有
  • 客服微信

  • 服务号