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构建功能程序的方法。不需要具备任何有关单核词或范畴论的知识。 P>
Monad可以提高修改程序的便利性。它们可以模仿不纯功能(例如异常,状态和延续)的影响;并且还提供使用这些功能不容易实现的效果。程序的类型反映了发生的效果。 P>
第一部分是使用monad的扩展示例。修改了Asimple解释器以支持各种额外功能:错误消息,状态,输出和不确定性选择。第二部分描述单子与连续通过风格之间的关系。第三部分概述了在Haskell编写的Haskell编译器中如何使用monads。 P>
机译:企业家教育方案的本质,目标和内容的作用:学习者残疾在泰国的调节作用
机译:用于解决大规模线性规划问题的蒙特卡洛应用程序和梯度设备:本质和繁琐性
机译:用超临界流体萃取啤酒花颗粒生产新颖的啤酒花香气-第2部分:通过密度程序化超临界流体萃取制备单一品种的花香,柑橘和辛辣啤酒花香精
机译:语义数据功能编程的本质
机译:HBCU司NCAA生活技能计划的性质和精髓,我机构的课程中的仆人领导的定性案例研究
机译:鸡精的体外和体内功能表征
机译:语义数据函数式编程的本质
机译:ada编译器验证摘要报告,证书编号:920915W1.11267,meridian software systems,Inc。meridian ada,版本4.1.3 Essence 386在DOs 5.0下,运行ms Windows 3.0 => Essence 386在DOs 5.0下,运行ms Windows 3.0