純粋関数型構造化プログラミング
Purely Functional Structured Programming
Purely Functional Structured Programming
@misc{obua2010purely,
title = {Purely Functional Structured Programming},
author = {Steven Obua},
year = {2010},
eprint = {1007.3023},
archivePrefix = {arXiv},
primaryClass = {cs.PL},
url = {https://arxiv.org/abs/1007.3023}
}
Obua, S. (2010). Purely Functional Structured Programming [Preprint]. arXiv. https://doi.org/10.48550/arXiv.1007.3023
OBUA S. Purely Functional Structured Programming[EB/OL]. (2010-07-18)[2026-11-29]. https://arxiv.org/abs/1007.3023.
要旨
関数型プログラミングの考え方は、現代の主要プログラミング言語の景観形成に大きな役割を果たしてきた。現在のプログラミングスタイルを支配するもう一つの概念は、ディルキストの構造化プログラミングである。両者の概念は、例えば Scala というプログラミング言語において成功して融合されている。本稿では、構造化プログラミングと純粋関数型プログラミングを LINEAR SCOPE という概念を通じて同様に融合させる方法を提案する。この提案の第一の利点は、主要なプログラマーが、既知の構造化プログラミング構文を使用し、モノアドなどの概念を知らなくても、純粋関数型プログラミングの利点である容易に利用可能な並列性を享受できる点である。第二の利点は、専門的な純粋関数型プログラマーが、構造化プログラミング構文を使用して、精神的に解析しやすいコードを用いることで、読みづらくなる関数型コードを回避できる点である。
The idea of functional programming has played a big role in shaping today's landscape of mainstream programming languages. Another concept that dominates the current programming style is Dijkstra's structured programming. Both concepts have been successfully married, for example in the programming language Scala. This paper proposes how the same can be achieved for structured programming and PURELY functional programming via the notion of LINEAR SCOPE. One advantage of this proposal is that mainstream programmers can reap the benefits of purely functional programming like easily exploitable parallelism while using familiar structured programming syntax and without knowing concepts like monads. A second advantage is that professional purely functional programmers can often avoid hard to read functional code by using structured programming syntax that is often easier to parse mentally.