arXivDaily arXiv每日学术速递 周一至周五更新
arXiv周末暂无论文更新,休息一下吧,周末愉快~~
arXiv 1803.10195cs.PL
收藏

当我们讨论单子时

What we talk about when we talk about monads

Tomas Petricek

摘要:

计算机科学提供了对编程概念的技术方面的深入理解,但如果我们想了解编程概念如何演变,程序员如何思考和谈论它们以及它们在实践中如何使用,我们需要考虑更广泛的视角,包括历史,哲学和认知方面。在本文中,我们开发了这样一个更广泛的理解单子,编程概念,有一个臭名昭著的正式定义,在几个程序设计语言的语法支持和优雅和强大的声誉,但也恐吓和难以掌握。这篇论文不是一个单子教程。它不会告诉你单子是什么。相反,它可以帮助你理解计算机科学家和程序员如何谈论monads以及他们为什么这样做。为了回答这些问题,我们回顾了程序设计背景下单子的历史,并从科学哲学、数学哲学和认知科学的角度研究了单子的发展。更一般地说,我们提出了一个框架来理解编程概念,认为他们在三个层面:正式的,隐喻和实现。我们的观察是基于科学方法和数学实体的既定结果-认知科学表明,在思考单子时使用的隐喻比广泛接受的更重要,而科学哲学则解释了单子起源的研究范式如何影响和限制它们的使用。最后,我们提供的证据,为什么更广泛的哲学,社会学的编程概念应该感兴趣的程序员。它让我们更好地理解编程概念,并从根本上选择更合适的抽象,如本文结束时的案例研究所示。

英文摘要:

Computer science provides an in-depth understanding of technical aspects of programming concepts, but if we want to understand how programming concepts evolve, how programmers think and talk about them and how they are used in practice, we need to consider a broader perspective that includes historical, philosophical and cognitive aspects. In this paper, we develop such broader understanding of monads, a programming concept that has an infamous formal definition, syntactic support in several programming languages and a reputation for being elegant and powerful, but also intimidating and difficult to grasp. This paper is not a monad tutorial. It will not tell you what a monad is. Instead, it helps you understand how computer scientists and programmers talk about monads and why they do so. To answer these questions, we review the history of monads in the context of programming and study the development through the perspectives of philosophy of science, philosophy of mathematics and cognitive sciences. More generally, we present a framework for understanding programming concepts that considers them at three levels: formal, metaphorical and implementation. We base such observations on established results about the scientific method and mathematical entities -- cognitive sciences suggest that the metaphors used when thinking about monads are more important than widely accepted, while philosophy of science explains how the research paradigm from which monads originate influences and restricts their use. Finally, we provide evidence for why a broader philosophical, sociological look at programming concepts should be of interest for programmers. It lets us understand programming concepts better and, fundamentally, choose more appropriate abstractions as illustrated in number of case studies that conclude the paper.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑