Programming with Arrows

Programming with Arrows
复制标题

用箭头编程

DOI:
--
复制
发表时间:
2004
期刊:
Advanced Functional Programming
影响因子:
--
通讯作者:
John Hughes
John Hughes
中科院分区:
--
文献类型:
--
作者:
John Hughes

文献摘要

被引文献

相似文献

考虑一个简单的haskell定义,该函数计算字符串中给定单词W的出现数: w =长度(== W) 这是“无点”编程样式的一个示例,我们通过构建其他功能来构建功能,并大量使用更高级的功能,例如无点编程。以及可读的定义,非常适合以鸟类和梅尔滕斯的方式等效推理[2]。
Consider this simple Haskell definition, of a function which counts the number of occurrences of a given word w in a string: count w = length . filter (==w) . words This is an example of “point-free” programming style, where we build a function by composing others, and make heavy use of higher-order functions such as filter. Point-free programming is rightly popular: used appropriately, it makes for concise and readable definitions, which are well suited to equational reasoning in the style of Bird and Meertens [2]. It’s also a natural way to assemble programs from components, and closely related to connecting programs via pipes in the UNIX shell.