【24h】

The essence of functional programming

机译:函数式编程的本质

获取原文

摘要

This paper explores the use monads to structure functionalprograms. No prior knowledge of monads or category theory isrequired.

Monads increase the ease with which programs may be modified.They can mimic the effect of impure features such as exceptions,state, and continuations; and also provide effects not easilyachieved with such features. The types of a program reflect whicheffects occur.

The first section is an extended example of the use of monads. Asimple interpreter is modified to support various extra features:error messages, state, output, and non-deterministic choice. Thesecond section describes the relation between monads and thecontinuation-passing style. The third section sketches how monadsare used in a compiler for Haskell that is written in Haskell.

机译:

本文探讨了使用monad构建功能程序的方法。不需要具备任何有关单核词或范畴论的知识。

Monad可以提高修改程序的便利性。它们可以模仿不纯功能(例如异常,状态和延续)的影响;并且还提供使用这些功能不容易实现的效果。程序的类型反映了发生的效果。

第一部分是使用monad的扩展示例。修改了Asimple解释器以支持各种额外功能:错误消息,状态,输出和不确定性选择。第二部分描述单子与连续通过风格之间的关系。第三部分概述了在Haskell编写的Haskell编译器中如何使用monads。

著录项

相似文献

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

客服邮箱:kefu@zhangqiaokeyan.com

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

  • 服务号