# Calculating Functional Programs

*Jeremy Gibbons*

### Abstract

A good way of developing a correct program is to *calculate* it from its specification. Functional programming languages are especially suitable for this, because their referential transparency greatly helps calculation. We discuss the ideas behind program calculation, and illustrate with an example (the *maximum segment sum* problem). We show that calculations are driven by *promotion*, and that promotion properties arise from *universal properties* of the data types involved.

Book Title

Proceedings of ISRG/SERG Research Colloquium

Editor

Keiichi Nakata

Month

nov

Note

Technical Report CMS−TR−98−01

Organisation

School of Computing and Mathematical Sciences‚ Oxford Brookes University

Year

1997