Abstract
Functional programs are merely equations; they may be manipulated by straightforward equational reasoning. In particular, one can use this style of reasoning to calculate programs, in the same way that one calculates numeric values in arithmetic. Many useful theorems for such reasoning derive from an algebraic view of programs, built around datatypes and their operations. Traditional algebraic methods concentrate on initial algebras, constructors, and values; dual co-algebraic methods concentrate on final co-algebras, destructors, and processes. Both methods are elegant and powerful; they deserve to be combined.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Similar content being viewed by others
References
Roland Backhouse. An exploration of the Bird-Meertens formalism. In International Summer School on Constructive Algorithmics, Hollum, Ameland. STOP project, 1989. Also available as Technical Report CS 8810, Department of Computer Science, Groningen University, 1988.
R. S. Bird, C. C. Morgan, and J. C. P. Woodcock, editors. LNCS 669: Mathematics of Program Construction. Springer-Verlag, 1993.
Richard Bird. Personal communication, 1999.
Richard Bird and Oege de Moor. The Algebra of Programming. Prentice-Hall, 1996.
Richard S. Bird. Introduction to Functional Programming Using Haskell. Prentice-Hall, 1998.
Stephen Brookes and Shai Geva. Computational comonads and intensional semantics. In M. P. Fourman, P. T. Johnstone, and A. M. Pitts, editors, Categories in Computer Science, London Mathematical Society Lecture Notes, pages 1–44. Cambridge University Press, 1992. Also Technical Report CMU-CS-91-190, School of Computer Science, Carnegie Mellon University.
Stephen Brookes and Kathryn Van Stone. Monads and comonads in intensional semantics. Technical Report CMU-CS-93-140, CMU, 1993.
Rod Burstall and David Rydeheard. Computational Category Theory. Prentice-Hall, 1988.
Roy L. Crole. Categories for Types. Cambridge University Press, 1994.
B. A. Davey and H. A. Priestley. Introduction to Lattices and Order. Mathematical Textbooks Series. Cambridge University Press, 1990.
Maarten M. Fokkinga and Erik Meijer. Program calculation properties of continuous algebras. Technical Report CS-R9104, CWI, Amsterdam, January 1991.
Jeremy Gibbons and Geraint Jones. The under-appreciated unfold. In Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming, pages 273–279, Baltimore, Maryland, September 1998.
J. A. Goguen, J. W. Thatcher, E. G. Wagner, and J. B. Wright. An introduction to categories, algebraic theories and algebras. Technical report, IBM Thomas J. Watson Research Centre, Yorktown Heights, April 1975.
J. A. Goguen, J. W. Thatcher, E. G. Wagner, and J. B. Wright. Initial algebra semantics and continuous algebras. Journal of the ACM, 24(1):68–95, January 1977.
Jeremy Gunawardena. Towards an applied mathematics for computer science. In M. S. Alber, B. Hu, and J. J. Rosenthal, editors, Current and Future Directions in Applied Mathematics. Birkhäuser, Boston, 1997.
Tatsuya Hagino. A Categorical Programming Language. PhD thesis, Department of Computer Science, University of Edinburgh, September 1987.
Tatsuya Hagino. A typed lambda calculus with categorical type constructors. In D. H. Pitt, A. Poigné, and D. E. Rydeheard, editors, LNCS 283: Category Theory and Computer Science, pages 140–157. Springer-Verlag, September 1987.
C. A. R. Hoare. Notes on data structuring. In Ole-Johan Dahl, Edsger W. Dijkstra, and C. A. R. Hoare, editors, Structured Programming, APIC studies in data processing, pages 83–174. Academic Press, 1972.
Graham Hutton. Fold and unfold for program semantics. In Proceedings of the Third ACM SIGPLAN International Conference on Functional Programming, Baltimore, Maryland, September 1998.
Graham Hutton. Personal communication, 1999.
Johan Jeuring, editor. LNCS 1422: Proceedings of Mathematics of Program Construction, Marstrand, Sweden, June 1998. Springer-Verlag.
Johan Jeuring and Erik Meijer, editors. LNCS 925: Advanced Functional Programming. Springer-Verlag, 1995. Lecture notes from the First International Spring School on Advanced Functional Programming Techniques, Båstad, Sweden.
Saunders Mac Lane. Categories for the Working Mathematician. Springer-Verlag, 1971.
Grant Malcolm. Algebraic Data Types and Program Transformation. PhD thesis, Rijksuniversiteit Groningen, September 1990.
Grant Malcolm. Data structures and program transformation. Science of Computer Programming, 14:255–279, 1990.
Lambert Meertens. Paramorphisms. Formal Aspects of Computing, 4(5):413–424, 1992.
Erik Meijer, Maarten Fokkinga, and Ross Paterson. Functional programming with bananas, lenses, envelopes and barbed wire. In John Hughes, editor, LNCS 523: Functional Programming Languages and Computer Architecture, pages 124–144. Springer-Verlag, 1991.
Eugenio Moggi. Notions of computation and monads. Information and Computation, 93(1), 1991.
Bernhard Möller. Personal communication, 1995.
Bernhard Möller, editor. LNCS 947: Mathematics of Program Construction. Springer-Verlag, 1995.
Benjamin C. Pierce. Basic Category Theory for Computer Scientists. MIT Press, 1991.
John C. Reynolds. Semantics of the domain of flow diagrams. Journal of the ACM, 24(3):484–503, 1977.
David A. Schmidt. Denotational Semantics: A Methodology for Language Development. Allyn and Bacon, 1986.
M. B. Smyth and G. D. Plotkin. The category-theoretic solution of recursive domain equations. SIAM Journal on Computing, 11(4):761–783, November 1982.
Joseph Stoy. Denotational Semantics: The Scott-Strachey Approach to Programming Language Theory. MIT Press, 1977.
Doaitse Swierstra and Oege de Moor. Virtual data structures. In Bernhard Möller, Helmut Partsch, and Steve Schumann, editors, LNCS 755: IFIP TC2/WG2.1 State-of-the-Art Report on Formal Program Development, pages 355–371. Springer-Verlag, 1993.
Daniele Turi. Functorial Operational Semantics and its Denotational Dual. PhD thesis, Vrije Universiteit Amsterdam, June 1996.
Tarmo Uustalu and Varmo Vene. Primitive (co)recursion and course-of-value (co)iteration. Research Report TRITA-IT R 98:02, Dept of Teleinformatics, Royal Institute of Technology, Stockholm, January 1998.
J. L. A. van de Snepscheut, editor. LNCS 375: Mathematics of Program Construction. Springer-Verlag, 1989.
Varmo Vene and Tarmo Uustalu. Functional programming with apomorphisms (corecursion). Proceedings of the Estonian Academy of Sciences: Physics, Mathematics, 47(3):147–161, 1998. 9th Nordic Workshop on Programming Theory.
Philip Wadler. Comprehending monads. Mathematical Structures in Computer Science, 2(4):461–493, 1992. Earlier version appeared in ACM Conference on Lisp and Functional Programming, 1990.
Philip Wadler. The essence of functional programming. In 19th Annual Symposium on Principles of Programming Languages, 1992.
Philip Wadler. Monads for functional programming. In M. Broy, editor, Program Design Calculi: Proceedings of the Marktoberdorf Summer School, 1992. Also in [22].
R. F. C. Walters. Datatypes in distributive categories. Bulletin of the Australian Mathematical Society, 40:79–82, 1989.
R. F. C. Walters. Categories and Computer Science. Computer Science Texts Series. Cambridge University Press, 1991.
R. F. C. Walters. An imperative language based on distributive categories. Mathematical Structures in Computer Science, 2:249–256, 1992.
Author information
Authors and Affiliations
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2002 Springer-Verlag Berlin Heidelberg
About this chapter
Cite this chapter
Gibbons, J. (2002). Calculating Functional Programs. In: Backhouse, R., Crole, R., Gibbons, J. (eds) Algebraic and Coalgebraic Methods in the Mathematics of Program Construction. Lecture Notes in Computer Science, vol 2297. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-47797-7_5
Download citation
DOI: https://doi.org/10.1007/3-540-47797-7_5
Published:
Publisher Name: Springer, Berlin, Heidelberg
Print ISBN: 978-3-540-43613-3
Online ISBN: 978-3-540-47797-6
eBook Packages: Springer Book Archive