Watch out for that tree! A tutorial on shortcut deforestation

Functional programmers are strong enthusiasts of modular solutions to programming problems. Since software characteristics such as readability or maintainability are often directly proportional to modularity, this programming style naturally contributes to the beauty of functional programs. Unfortun...

Full description

Bibliographic Details
Main Author: Fernandes, João Paulo (author)
Other Authors: Cunha, Jácome (author), Saraiva, João (author), Pardo, Alberto (author)
Format: conferencePaper
Language:eng
Published: 2019
Subjects:
Online Access:http://hdl.handle.net/1822/68167
Country:Portugal
Oai:oai:repositorium.sdum.uminho.pt:1822/68167
Description
Summary:Functional programmers are strong enthusiasts of modular solutions to programming problems. Since software characteristics such as readability or maintainability are often directly proportional to modularity, this programming style naturally contributes to the beauty of functional programs. Unfortunately, in return of this beauty we often sacrifice efficiency: modular programs rely, at runtime, on the creation, use and elimination of intermediate data structures to connect its components. In this tutorial paper, we study an advanced technique that attempts to retain the best of this two worlds: (i) it allows programmers to implement beautiful, modular programs (ii) it shows how to transform such programs, in a way that can be incorporated in a compiler, into programs that do not construct any intermediate structure.