Random Access to Abstract Data Types

  • Martin Erwig
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 1816)


We show how to define recursion operators for random access data types, that is, ADTs that offer random access to their elements, and how algorithms on arrays and on graphs can be expressed by these operators. The approach is essentially based on a representation of ADTs as bialgebras that allows catamorphisms between ADTs to be defined by composing one ADT’s algebra with the other ADT’s coalgebra. The extension to indexed data types enables the development of specific recursion schemes, which are, in particular, suited to express a large class of graph algorithms.


Category Theory ADT Catamorphism Graph Algorithm 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    R. S. Bird. Lectures on Constructive Functional Programming. In M. Broy, editor, Constructive Methods in Computer Science, NATO ASI Series, Vol. 55, pages 151–216, 1989.Google Scholar
  2. 2.
    R. S. Bird and O. de Moor. The Algebra of Programming. Prentice-Hall International, 1997.Google Scholar
  3. 3.
    T.-R. Chuang. A Functional Perspective of Array Primitives. In 2nd Fuji Int. Workshop on Functional and Logic Programming, pages 71–90, 1996.Google Scholar
  4. 4.
    M. Erwig. Graph Algorithms = Iteration + Data Structures? The Structure of Graph Algorithms and a Corresponding Style of Programming. In 18th Int. Workshop on Graph-Theoretic Concepts in Computer Science, LNCS 657, pages 277–292, 1992.Google Scholar
  5. 5.
    M. Erwig. Functional Programming with Graphs. In 2nd ACM Int. Conf. on Functional Programming, pages 52–65, 1997.Google Scholar
  6. 6.
    M. Erwig. Categorical Programming with Abstract Data Types. In 7th Int. Conf. on Algebraic Methodology and Software Technology, LNCS 1548, pages 406–421, 1998.CrossRefGoogle Scholar
  7. 7.
    M. Erwig. The Categorical Imperative — Or: How to Hide Your State Monads. In 10th Int. Workshop on Implementation of Functional Languages, pages 1–25, 1998.Google Scholar
  8. 8.
    M. Erwig. Random Access to Abstract Data Types. Technical Report 266, FernUniversität Hagen, 2000.Google Scholar
  9. 9.
    L. Fegaras and T. Sheard. Revisiting Catamorphisms over Datatypes with Embedded Functions. In 23rd ACM Symp. on Principles of Programming Languages, pages 284–294, 1996.Google Scholar
  10. 10.
    M. M. Fokkinga. Law and Order in Algorithmics. PhD thesis, University of Twente, 1992.Google Scholar
  11. 11.
    M. M. Fokkinga. Datatype Laws without Signatures. Mathematical Structures in Computer Science, 6:1–32, 1996.zbMATHMathSciNetCrossRefGoogle Scholar
  12. 12.
    J. Gibbons. An Initial Algebra Approach to Directed Acyclic Graphs. In Mathematics of Program Construction, LNCS 947, pages 282–303, 1995.Google Scholar
  13. 13.
    A. Gill, J. Launchbury, and S. L. Peyton Jones. A Short Cut to Deforestation. In Conf. on Functional Programming and Computer Architecture, pages 223–232, 1993.Google Scholar
  14. 14.
    J. T. Jeuring. Theories for Algorithm Calculation. PhD thesis, University of Utrecht, 1993.Google Scholar
  15. 15.
    G. Malcolm. Homomorphisms and Promotability. In Mathematics of Program Construction, LNCS 375, pages 335–347, 1989.Google Scholar
  16. 16.
    L. Meertens. Algorithmics — Towards Programming as a Mathematical Activity. In CWI Symp. on Mathematics and Computer Science, pages 289–334, 1986.Google Scholar
  17. 17.
    E. Meijer, M. Fokkinga, and R. Paterson. Functional Programming with Bananas, Lenses, Envelopes and Barbed Wire. In Conf. on Functional Programming and Computer Architecture, pages 124–144, 1991.Google Scholar
  18. 18.
    E. Meijer and G. Hutton. Bananas in Space: Extending Fold and Unfold to Exponential Types. In Conf. on Functional Programming and Computer Architecture, pages 324–333, 1995.Google Scholar
  19. 19.
    T. Sheard and L. Fegaras. A Fold for all Seasons. In Conf. on Functional Programming and Computer Architecture, pages 233–242, 1993.Google Scholar
  20. 20.
    A. Takano and E. Meijer. Shortcut Deforestation in Calculational Form. In Conf. on Functional Programming and Computer Architecture, pages 306–313, 1995.Google Scholar
  21. 21.
    P. Wadler. Theorems for Free! In Conf. on Functional Programming and Computer Architecture, pages 347–359, 1989.Google Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2000

Authors and Affiliations

  • Martin Erwig
    • 1
  1. 1.Praktische Informatik IVFernUniversität HagenHagenGermany

Personalised recommendations