Skip to main content
Log in

Categorical ML — Category-theoretic modular programming

  • Published:
Formal Aspects of Computing

Abstract

We consider an extension of the functional programming language Standard ML with a modular structure based upon concepts in category theory such as categories, functors, natural transformations and adjunctions. In essence, we are following the categorical imperative of considering arrows as well as objects. This is intended to enforce a certain mathematical rigour on the programmer, so that the only programs that can be expressed are those with a categorical significance. The essentially algebraic nature of category theory means that we may generate equational correctness conditions for the modular structure of programs, thus separating the correctness of individual functions from that of modules. We describe this programming language, give examples of its use, and explain how it is implemented in a type system.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Burstall, R.: Computer Assisted Proof for Mathematics: an Introduction using the LEGO Proof System,Internal Report ECS-LFCS-91-132, Laboratory for the Foundations of Computer Science, Dept. of Computer Science, University of Edinburgh, UK.

  2. Burstall, R. and Lampson, B.: A Kernel Language for Modules and Abstract Data Types,Semantics of Data Types, Springer LNCS 173, pp. 1–50. 1984.

  3. Coquand, T. and Huet, G.: Constructions: A Higher Order Proof System for Mechanising Mathematics,Proc. EUROCAL85, Linz, Springer LNCS 203. 1985.

  4. Curien, P.-L.:Categorical Combinators, Sequential Algorithms and Functional Programming, Research Notes in Theoretical Computer Science, Pitman, London, 1986.

    Google Scholar 

  5. Cardelli, L. and Wegner, P.: On Understanding Types, Data Abstraction and Polymorphism,ACM Computing Surveys 17, 4, pp. 471–521, 1985.

    Google Scholar 

  6. Dick, A.J.J.: ERIL — Equational reasoning: an interactive laboratory. Rutherford Appleton Laboratory, Report RAL-86-010. March 1985.

  7. Dyckhoff, R.: Category theory as an extension of Martin-Löf type theory. Internal Report CS 85/3, Department of Computational Science, University of St. Andrews, Scotland.

  8. Hagino, T.: A Categorical Programming Language, PhD. Thesis, Edinburgh, 1987.

  9. Hudak, P., Wadler, P. et al.: Report on the Functional Programming Language, Haskell. Draft proposed standard. Preprint, Dept. Computer Science, University of Glasgow, UK, 1988.

    Google Scholar 

  10. Lescanne, P.: Computer experiments with the REVE term rewriting system generator.Proc 10th ACM POPL Symposium, Austin, Texas, 1983. pp 99–1080.

    Google Scholar 

  11. Mac Lane, S.:Categories for the Working Mathematician. Springer-Verlag, 1971.

  12. MacQueen, D.B.: Using Dependent Types to Express Modular Structure,Proc. 13th Annual ACM POPL Symposium, 1986.

  13. Milner, R., Tofte, M. and Harper, R.:The Definition of Standard ML, The MIT Press, 1990.

  14. Moggi, E.: Category-Theoretic Account of Program Modules,Proc. Category Theory and Computer Science, Manchester 1989, Springer LNCS 389, pp. 101–117. 1989.

  15. Mitchell, J.C. and Plotkin, G.D.: Abstract types have existential type,Proc. 12th Annual ACM POPL Symposium, pp. 37–51. 1985.

  16. Rydeheard, D.E. and Burstall, R.M.:Computational Category Theory, Prentice Hall, 1988.

  17. Sannella, D.T. and Tarlecki, A.: Program Specification and Development in Standard ML,Proc. 12th Annual ACM POPL Symposium, 1985.

  18. Wadler, P. and Blott, S.: How to makead hoc polymorphism lessad hoc. InProceedings of 16th ACM Symposium on Principles of Programming Languages, A.C.M., 1989.

  19. Watjen, D. and Struckmann, W.: An Algorithm for Verifying Equations of Morphisms in a Category.Information Processing Letters, 14, 3. pp. 104–108. 1982.

    Google Scholar 

  20. Wraith, G.C.: Categorical Data Types,Proc. Category Theory and Computer Science,Manchester 1989, Springer LNCS 389, pp. 118–127. 1989.

  21. Wikström, A.:Functional Programming using Standard ML. Prentice Hall, 1987.

Download references

Author information

Authors and Affiliations

Authors

Rights and permissions

Reprints and permissions

About this article

Cite this article

Dennis-Jones, E., Rydeheard, D.E. Categorical ML — Category-theoretic modular programming. Formal Aspects of Computing 5, 337–366 (1993). https://doi.org/10.1007/BF01212406

Download citation

  • Received:

  • Accepted:

  • Issue Date:

  • DOI: https://doi.org/10.1007/BF01212406

Keywords

Navigation