Scrap your Boilerplate!

Advanced Programming Specialist Group event

Thursday 1 April 2004, 6.00 pm

Seminar Room 1, Cruciform Building Foyer , University College London, Gower Street WC1. The Cruciform Building is opposite the main gate to University College, on the opposite side of Gower Street. Enter the Cruciform Building and pass through the double doors; then go through the door on the left, and up the staircase to the 1st floor. Seminar Room 1 is on the left. The nearest underground stations are Warren Street, Goodge Street, Tottenham Court Road, or Euston Square.

Simon Peyton Jones (Microsoft Research, Cambridge), Ralf Laemmel (Vrije University, Amsterdam).

Many programs traverse data structures built from rich mutually-recursive data types. Such programs often have a great deal of "boilerplate" code that simply walks the structure, hiding a small amount of "real" code that constitutes the reason for the traversal.

"Generic programming" is the umbrella term to describe a wide variety of programming technology directed at this problem. All these techniques aim to provide mechanical support for the "boilerplate" part, leaving the programmer free to concentrate on the important part of the algorithm. Such generic programs are much more robust to data structure evolution, because they contain many fewer lines of type-specific code.

The trouble is that most generic programming techniques either require significant support from the programming language itself, or are inconvenient for the programmer. In this talk I will describe a new approach to generic programming based on the functional language Haskell, which combines programming convenience with very modest demands on the language.

Our approach is simple to understand, elegant, reasonably efficient, and handles all the data types found in conventional functional programming languages. It makes essential use of rank-2 polymorphism, an extension found in some implementations of Haskell.

The talk is a development of work first reported in "Scrap your boilerplate", Laemmel & Peyton Jones, Proc ACM SIGPLAN Workshop on Types in Language Design and Implementation (TLDI 2003). Further info at

Free, but please ask Dr Frank Martin to add your name to the security list by e-mailing him at -: Notification is required individually for each meeting.

CPD Value:
Half unit