跳到正文
EasyXiv 检索
投稿 关于 登录

按回车检索 · 直接输入编号(如 1706.03762)可跳转到论文

计算机科学 > 程序设计语言

arXiv:2002.06176 (cs)
[提交于 2020年2月14日]

标题:Functional Programming in Pattern-Match-Oriented Programming Style

作者:Satoshi Egi, Yuichi Nishiwaki
查看论文《Functional Programming in Pattern-Match-Oriented Programming Style》的 PDF
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读
摘要:Throughout the history of functional programming, recursion has emerged as a natural method for describing loops in programs. However, there does often exist a substantial cognitive distance between the recursive definition and the simplest explanation of an algorithm even for the basic list processing functions such as map, concat, or unique; when we explain these functions, we seldom use recursion explicitly as we do in functional programming. For example, map is often explained as follows: the map function takes a function and a list and returns a list of the results of applying the function to all the elements of the list. This paper advocates a new programming paradigm called pattern-match-oriented programming for filling this gap. An essential ingredient of our method is utilizing pattern matching for non-free data types. Pattern matching for non-free data types features non-linear pattern matching with backtracking and extensibility of pattern-matching algorithms. Several non-standard pattern constructs, such as not-patterns, loop patterns, and sequential patterns, are derived from this pattern-matching facility. Based on that result, this paper introduces many programming techniques that replace explicit recursions with an intuitive pattern by confining recursions inside patterns. We classify these techniques as pattern-match-oriented programming design patterns. These programming techniques allow us to redefine not only the most basic functions for list processing such as map, concat, or unique more elegantly than the traditional functional programming style, but also more practical mathematical algorithms and software such as a SAT solver, computer algebra system, and database query language that we had not been able to implement concisely.
主题: 程序设计语言 (cs.PL)
引用方式: arXiv:2002.06176 [cs.PL]
  (或者 arXiv:2002.06176v1 [cs.PL] 对于此版本)
  https://doi.org/10.48550/arXiv.2002.06176
期刊参考: The Art, Science, and Engineering of Programming, 2020, Vol. 4, Issue 3, Article 7
相关 DOI: https://doi.org/10.22152/programming-journal.org/2020/4/7

提交历史

来自:Satoshi Egi
[v1] 2020年2月14日 星期五 18:55:54 UTC
全文链接:

访问论文:

  • 查看原文 PDF
  • 中文 PDF (下批处理)
  • EasyResearch 阅读
  • TeX 源文件
  • arXiv 原文页面
查看许可

当前浏览上下文:

cs.PL
< 上一篇   |   下一篇 >
最新 | 近期 | 2020-02
切换浏览方式为:
cs

参考文献与引用

  • Google Scholar
  • Semantic Scholar

BibTeX 格式的引用

EasyXiv 是独立运营的中文预印本站点,与 arXiv 及康奈尔大学无隶属关系。 论文元数据与原文来自 arXiv.org,感谢 arXiv 提供开放获取服务。
关于 · 帮助 · 投稿指南 · 版权 · arXiv 原站