Hostname: page-component-8448b6f56d-wq2xx Total loading time: 0 Render date: 2024-04-25T00:39:20.313Z Has data issue: false hasContentIssue false

Generic functional programming with types and relations

Published online by Cambridge University Press:  07 November 2008

Richard Bird
Affiliation:
Programming Research Group, Oxford University, Wolfson Building, Parks Road, Oxford OX1 3QD, UK
Oege De Moor
Affiliation:
Programming Research Group, Oxford University, Wolfson Building, Parks Road, Oxford OX1 3QD, UK
Paul Hoogendijk
Affiliation:
Eindhoven University of Technology, PO Box 513, 5600 MB Eindhoven, The Netherlands
Rights & Permissions [Opens in a new window]

Abstract

Core share and HTML view are not available for this content. However, as you have access to this content, a full PDF is available via the ‘Save PDF’ action button.

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.

Type
Articles
Copyright
Copyright © Cambridge University Press 1996

References

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 ftp.win.tue.nl in directory pub/math.prog.construction.Google Scholar
Barr, M. and Wells, C. (1985) Toposes, triples and theories. Grundlehren der Math. Wissenschaften, 278. Springer-Verlag.Google Scholar
Barr, M. and Wells, C. (1990). Category Theory for Computing Science. Prentice–Hall.Google Scholar
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.Google Scholar
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.Google Scholar
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.Google Scholar
Bird, R. and de Moor, O. (1996) The Algebra of Programming. Prentice Hall International.Google Scholar
Bird, R. S. (1989b) Algebraic identities for program calculation. The Computer J., 32: 122126.Google Scholar
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): 4795Google Scholar
De Moor, O. (1992) Categories, relations and dynamic programming. DPhil thesis. Technical Monograph PRG-98. Computing Laboratory, Oxford University.Google Scholar
De Moor, O. (1993) Working notes on membership of data types. Unpublished manuscriptGoogle Scholar
Freyd, P. J. and Ščedrov, A. (1990) Categories, allegories. Mathematical Library, vol. 39. North-Holland.Google Scholar
Gibbons, J. (1991) Algebras for tree algorithms. DPhil thesis, Programming Research Group, Computing Laboratory, Oxford University.Google Scholar
Goldblatt, R. (1986) Topoi – the categorial analysis of logic. Studies in Logic and the Foundations of Mathematics, vol. 98. North-Holland.Google Scholar
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.Google Scholar
Johnstone, P. T. (1977) Topos Theory. Academic Press.Google Scholar
Jones, M. P. (1993) A system of constructor classes: overloading and implicit higher-order polymorphism. Proc. FPCA. To appear.Google Scholar
Lehmann, D. J. and Smyth, M. B. (1981) Algebraic specification of data types: A synthetic approach. Math. Systems Theory, 14: 97139.CrossRefGoogle Scholar
Malcolm, G. (1990) Data structures and program transformation. Science of Computer Programming, 14: 255279.CrossRefGoogle Scholar
Manes, E. G. and Arbib, M. A. (1986) Algebraic Approaches to Program Semantics. Texts and Monographs in Computer Science. Springer-Verlag.Google Scholar
Pierce, B. C. (1991) Basic Category Theory for Computer Scientists. MIT Press.Google Scholar
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).CrossRefGoogle Scholar
Wadler, P. (1990) Deforestation. Theoretical Computer Science, 73(2): 231248.Google Scholar
Submit a response

Discussions

No Discussions have been published for this article.