Skip to main content Accessibility help

Generic functional programming with types and relations

  • Richard Bird (a1), Oege De Moor (a1) and Paul Hoogendijk (a2)


A generic functional program is one which is parameterised by datatype. By installing specific choices, for example lists or trees, different programs are obtained that are, nevertheless, abstractly the same. The purpose of this paper is to explore the possibility of deriving generic programs. Part of the theory of lists that deals with segments is recast as a theory about ‘segments’ in a wide class of datatypes, and then used to pose and solve a generic version of a well-known problem.



Hide All
Aarts, C. J., Backhouse, R. C., Hoogendijk, P., Voermans, E. and Van der Woude, J. C. S. P. (1992) A relational theory of datatypes. Available via anonymous ftp from in directory pub/
Barr, M. and Wells, C. (1985) Toposes, triples and theories. Grundlehren der Math. Wissenschaften, 278. Springer-Verlag.
Barr, M. and Wells, C. (1990). Category Theory for Computing Science. Prentice–Hall.
Bird, R. S. (1987) An introduction to the theory of lists. In: Broy, M. (ed), Logic of Programming and Calculi of Discrete Design. NATO ASI Series F, 36, pp. 342. Springer-Verlag.
Bird, R. S. (1989a) Lectures on constructive functional programming. In: Broy, M. (ed), Constructive Methods in Computing Science. NATO ASI Series F, 55, pp. 151216.Springer-Verlag.
Bird, R. S. (1990) A calculus of functions for program derivation. In: Turner, D. A. (ed), Research Topics in Functional Programming, pp. 287308. University of Texas at Austin Year of Programming Series. Addison-Wesley.
Bird, R. and de Moor, O. (1996) The Algebra of Programming. Prentice Hall International.
Bird, R. S. (1989b) Algebraic identities for program calculation. The Computer J., 32: 122126.
Carboni, A., Kelly, G. M. and Wood, R. J. (1991) A 2-categorical approach to geometric morphisms I. Cahiers de topologie et geometrie differentielle categoriques, 32(1): 4795
De Moor, O. (1992) Categories, relations and dynamic programming. DPhil thesis. Technical Monograph PRG-98. Computing Laboratory, Oxford University.
De Moor, O. (1993) Working notes on membership of data types. Unpublished manuscript
Freyd, P. J. and Ščedrov, A. (1990) Categories, allegories. Mathematical Library, vol. 39. North-Holland.
Gibbons, J. (1991) Algebras for tree algorithms. DPhil thesis, Programming Research Group, Computing Laboratory, Oxford University.
Goldblatt, R. (1986) Topoi – the categorial analysis of logic. Studies in Logic and the Foundations of Mathematics, vol. 98. North-Holland.
Jeuring, J. (1989) Deriving algorithms on binary labelled trees. In: Apers, P. M. G.Bosman, D. and Van Leeuwen, J. (eds), Proc. sion Computing Science in the Netherlands, pp. 229249.
Johnstone, P. T. (1977) Topos Theory. Academic Press.
Jones, M. P. (1993) A system of constructor classes: overloading and implicit higher-order polymorphism. Proc. FPCA. To appear.
Lehmann, D. J. and Smyth, M. B. (1981) Algebraic specification of data types: A synthetic approach. Math. Systems Theory, 14: 97139.
Malcolm, G. (1990) Data structures and program transformation. Science of Computer Programming, 14: 255279.
Manes, E. G. and Arbib, M. A. (1986) Algebraic Approaches to Program Semantics. Texts and Monographs in Computer Science. Springer-Verlag.
Pierce, B. C. (1991) Basic Category Theory for Computer Scientists. MIT Press.
Swierstra, S. D. and De Moor, O. (1992) Virtual data structures. Proc. State-of-the-Art Seminar on Formal Program Development,Rio de Janeiro,Brazil (to appear).
Wadler, P. (1990) Deforestation. Theoretical Computer Science, 73(2): 231248.


Full text views

Total number of HTML views: 0
Total number of PDF views: 0 *
Loading metrics...

Abstract views

Total abstract views: 0 *
Loading metrics...

* Views captured on Cambridge Core between <date>. This data will be updated every 24 hours.

Usage data cannot currently be displayed

Generic functional programming with types and relations

  • Richard Bird (a1), Oege De Moor (a1) and Paul Hoogendijk (a2)
Submit a response


No Discussions have been published for this article.


Reply to: Submit a response

Your details

Conflicting interests

Do you have any conflicting interests? *