순수 함수형 구조화 프로그래밍
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 개념을 통해 구조화 프로그래밍과 PURELY functional 프로그래밍을 어떻게 결합할 수 있는지를 제안한다. 이 제안의 한 가지 장점은 메인스트림 프로그래머들이 모나드 (monads) 와 같은 개념을 알지 못하더라도 익숙한 구조화 프로그래밍 문법을 사용하여 순수 함수형 프로그래밍의 이점, 예를 들어 쉽게 활용 가능한 병렬성을 누릴 수 있다는 것이다. 두 번째 장점은 전문적인 순수 함수형 프로그래머들이 구조화 프로그래밍 문법을 사용하여 종종 더 쉽게 파싱할 수 있는 문법을 사용하여 가독성이 어려운 함수형 코드를 피할 수 있다는 것이다.
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.