The Fun of Programming

Front cover of book

Edited by Jeremy Gibbons and Oege de Moor in honour of Richard Bird's 60th birthday. A symposium was held to mark the occasion. Information about the book and ordering details can be found here.

Some of the code and software from the book is available from the links below. Please note that the software versions will be those from around the time of publication of the book and are provided here for the convenience of those wishing to "dip into" the chapters or use a version known to work with the examples in them. If you want to use any of these pieces of software seriously, you are strongly encouraged to obtain the latest version from the appropriate webpage, linked below.

The entire collection is also available as a gzipped tar archive and a zip file.

Answers to the exercises for some of the chapters are available, and will be released to bona fide instructors. Currently this only includes chapters 3 and 5. Please contact Jeremy Gibbons for details.

Chapter 1, Fun with binary heap trees, Chris Okasaki

Code from the chapter, all Haskell 98 compliant: Binary heap trees, Maxiphobic heaps, Round-robin heaps, Skew heaps

Chapter 2, Specification-based testing with QuickCheck, Koen Claessen and John Hughes

QuickCheck: gzipped tar archive, zip file.
(Note that QuickCheck is distributed with GHC and Hugs.)

The QuickCheck homepage

Code from the chapter, all Haskell 98 compliant:
      Queues: incorrect, corrected, incorrect algebraic, corrected algebraic.
      Thereom Prover: incorrect, corrected.

Chapter 3, Origami programming, Jeremy Gibbons

Code from the chapter, all Haskell 98 compliant: Lists, Numbers, Trees.

Chapter 4, Describing and interpreting music in Haskell, Paul Hudak

Haskore: gzipped tar archive, zip file.

The Haskore homepage

Code from the chapter, Haskell 98 compliant: Music.hs.

Chapter 5, Mechanising fusion, Ganesh Sittampalam and Oege de Moor

MAG: gzipped tar archive, zip file.

The MAG homepage

Chapter 6, How to write a financial contract, Simon Peyton Jones and Jean-Marc Eber

No code or software available.

The commercial product MLFi is based on the concepts in this chapter.

Chapter 7, Functional images, Conal Elliott

Pan (binaries are Windows only, but source provided): gzipped tar archive, zip file.

The Pan homepage

Chapter 8, Functional hardware description in Lava, Koen Claessen, Mary Sheeran and Satnam Singh

The Xilinx distribution of Lava should be available shortly from here.

Chapter 9, Combinators for logic programming, Mike Spivey and Silvija Seres

Code from the chapter, Haskell 98 compliant: Logic.hs

Chapter 10, Arrows and computation, Ross Paterson

Arrows notation preprocessor: gzipped tar archive, zip file.
(Note that the 6.2 release of GHC will contain in-built support for arrows notation.)

The arrows preprocessor homepage

Chapter 11, A prettier printer, Philip Wadler

Code from the chapter, all Haskell 98 compliant: Prettier printer, Tree example, XML example.

Chapter 12, Fun with phantom types, Ralf Hinze

Code from the chapter, requires Haskell 98 + existential types: Term representation, Generic functions, Dynamic values, Generic traversals and queries, Normalisation by evaluation, Functional unparsing, Phantom typing library.


Ganesh Sittampalam, October 2003.