Generalising monads to arrows

被引:240
作者
Hughes, J [1 ]
机构
[1] Chalmers Tekn Hgsk, Inst Datavetenskap, S-41296 Gothenburg, Sweden
关键词
D O I
10.1016/S0167-6423(99)00023-4
中图分类号
TP31 [计算机软件];
学科分类号
081202 ; 0835 ;
摘要
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. (C) 2000 Elsevier Science B.V. All rights reserved.
引用
收藏
页码:67 / 111
页数:45
相关论文
共 16 条
  • [1] Barr M., 1990, Category theory for computing science
  • [2] BJESSE P, 1998, INT C FUNCT PROGR
  • [3] Carlsson M., 1993, FPCA '93. Conference on Functional Programming Languages and Computer Architecture, P321, DOI 10.1145/165180.165228
  • [4] Elliott C., 1997, INT C FUNCT PROGR
  • [5] HUDAK P, 1992, SIGPLAN NOTICES
  • [6] HUDAK P, 1992, REPORT PROGRAMMING L
  • [7] KING DJ, 1992, GLASG WORKSH FUNCT P
  • [8] Lang S., 1995, C REC POPL 95 22 ACM, P333
  • [9] Mac Lane S., 1971, SPRINGER VERLAG GRAD, V5
  • [10] PETERSON J, 1996, YALEUDCSRR1106 YAL U