Abstract
We demonstrate how to build certain cyclic and other multi-linked structures in the lazy functional programming language Haskell. No explicit pointers are used in these constructions. Each task is accomplished by starting with a suitable specification and then calculating the required program.
Similar content being viewed by others
References
Bird RS (2010) Pearls of functional algorithm design. Cambridge University Press, Cambridge
Bird RS, Hinze R (2003) Trouble shared is trouble halved. ACM SIGPLAN Haskell Workshop, Uppsala, Sweden
Bornat R (2000) Proving pointer programs in Hoare logic. In: LNCS 1837: Fifth mathematics of program construction conference, pp 102–126
Butler M (1999) Calculational derivation of pointer algorithms from tree operations. Sci Compt Program 33(3): 221–260
Cormen TH, Leiserson CE, Rivest RL, Stein C (2001) Introduction to algorithms. MIT Press, Cambridge
Coutts D (2012) Building recursive data structures in Haskell. http://www.cs.ox.ac.uk/duncan.coutts/papers/recursive_data_structures_in_haskell.pdf
Tying the Knot (2012) http://www.haskell.org/haskellwiki/Tying_the_Knot
Hoare CARH (1972) Notes on data structuring. In: Structured programming. Academic Press, London
Knuth DE, Morris JH, Pratt VR (1977) Fast pattern matching in strings. SIAM J Comput 6: 323–350
Kaldewaij A (1990) Programming: the derivation of algorithms. Prentice-Hall, Reading, UK
McCarthy J (1963) A basis for a mathematical theory of computation. In: Brafford P, Hirschberg D (eds) Computer programming and formal systems. North-Holland, Amsterdam
Möller B (1997) Calculating with pointer structures. IFIP TC2/WG2.1 Working conference on Algorithmic Languages and Calculi, Chapman and Hall, London, UK
Morgan C (1994) Programming from Specifications, 2nd edn. http://www.cs.ox.ac.uk/publications/books/PfS/
O’Hearn PW, Yang H, Reynolds J (2004) Separation and Information Hiding. 31st Principles of Programming Languages Conference. ACM Publications, New York, pp 268–280
Sloane NJA (2012) On-Line Encyclopedia of Integer Sequences: A002627. http:///www.oeis.org
Author information
Authors and Affiliations
Corresponding author
Additional information
Peter Höfner, Robert van Glabbeek and Ian Hayes
For Carroll Morgan on the occasion of his 60th birthday
Rights and permissions
About this article
Cite this article
Bird, R.S. On building cyclic and shared structures in Haskell. Form Asp Comp 24, 609–621 (2012). https://doi.org/10.1007/s00165-012-0243-6
Received:
Revised:
Accepted:
Published:
Issue Date:
DOI: https://doi.org/10.1007/s00165-012-0243-6