Generalising monads to arrows

Generalising monads to arrows
复制标题

将单子概括为箭头

DOI:
10.1016/s0167-6423(99)00023-4
复制
发表时间:
2000
期刊:
Sci. Comput. Program.
影响因子:
--
通讯作者:
John Hughes
John Hughes
中科院分区:
--
文献类型:
--
作者:
John Hughes

文献摘要

被引文献

相似文献

自从Wadler在1990年介绍了Monad的使用以来,Monad在构造函数式程序方面变得非常流行。特别是,组合子库通常基于一元类型。这样的库共享(部分)一个公共接口,从中产生许多好处,例如编写与任何库一起工作的通用代码的可能性。但是,一些有趣而有用的库从根本上与monadic接口不兼容。在本文中,我提出了一个概括的单子,我称之为箭头,具有显着更广泛的适用性。本文展示了有多少一元编程的技术推广到新的设置,并给出了例子,以表明更大的普遍性是有用的。特别是,三个非一元库的高效解析,构建图形用户界面,并编程活动网页自然适合新的框架。
Monads have become very popular for structuring functional programs since Wadler introduced their use in 1990. In particular, libraries of combinators are often based on a monadic type. Such libraries share (in part) a common interface, from which numerous benefits flow, such as the possibility to write generic code which works together with any library. But, several interesting and useful libraries are fundamentally incompatible with the monadic interface. In this paper I propose a generalisation of monads, which I call arrows, with significantly wider applicability. The paper shows how many of the techniques of monadic programming generalise to the new setting, and gives examples to show that the greater generality is useful. In particular, three non-monadic libraries for efficient parsing, building graphical user interfaces, and programming active web pages fit naturally into the new framework.