Skip to main content
Log in

On building cyclic and shared structures in Haskell

  • Original Article
  • Published:
Formal Aspects of Computing

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.

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. Bird RS (2010) Pearls of functional algorithm design. Cambridge University Press, Cambridge

    MATH  Google Scholar 

  2. Bird RS, Hinze R (2003) Trouble shared is trouble halved. ACM SIGPLAN Haskell Workshop, Uppsala, Sweden

  3. Bornat R (2000) Proving pointer programs in Hoare logic. In: LNCS 1837: Fifth mathematics of program construction conference, pp 102–126

  4. Butler M (1999) Calculational derivation of pointer algorithms from tree operations. Sci Compt Program 33(3): 221–260

    Article  MATH  Google Scholar 

  5. Cormen TH, Leiserson CE, Rivest RL, Stein C (2001) Introduction to algorithms. MIT Press, Cambridge

    MATH  Google Scholar 

  6. Coutts D (2012) Building recursive data structures in Haskell. http://www.cs.ox.ac.uk/duncan.coutts/papers/recursive_data_structures_in_haskell.pdf

  7. Tying the Knot (2012) http://www.haskell.org/haskellwiki/Tying_the_Knot

  8. Hoare CARH (1972) Notes on data structuring. In: Structured programming. Academic Press, London

  9. Knuth DE, Morris JH, Pratt VR (1977) Fast pattern matching in strings. SIAM J Comput 6: 323–350

    Article  MathSciNet  MATH  Google Scholar 

  10. Kaldewaij A (1990) Programming: the derivation of algorithms. Prentice-Hall, Reading, UK

    Google Scholar 

  11. 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

    Google Scholar 

  12. Möller B (1997) Calculating with pointer structures. IFIP TC2/WG2.1 Working conference on Algorithmic Languages and Calculi, Chapman and Hall, London, UK

  13. Morgan C (1994) Programming from Specifications, 2nd edn. http://www.cs.ox.ac.uk/publications/books/PfS/

  14. 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

  15. Sloane NJA (2012) On-Line Encyclopedia of Integer Sequences: A002627. http:///www.oeis.org

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Richard S. Bird.

Additional information

Peter Höfner, Robert van Glabbeek and Ian Hayes

For Carroll Morgan on the occasion of his 60th birthday

Rights and permissions

Reprints 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

Download citation

  • Received:

  • Revised:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s00165-012-0243-6

Keywords

Navigation