is the `official' web-page for this course and has schedule information. This page provides the same description.
Software usually works with structured information; think of Web-browsers and HTML-documents. This structure can be represented by a data type or a DTD (Document Type Definition). If such a type changes, all programs that work on that type have to be changed too, although often the central problem does not change.
In the course on generic programming we will discuss methods with which problems can be formulated and solved for arbitrary data types or DTDs. The result is a generic program. An example of a generic program is a program for pattern matching: finding occurrences of a patterns in a given value. This problem is well known in the domain of strings, but it is equally important for trees or matrices. By specialising to a given type we get a normal, type-specific program. Many design patterns are also instances of generic programs.
In the course we will discuss generic programming by means of a number of example problems. You will also see some basic lambda calculus, which can be used to type-check and specialize generic programs. We will use the programming language Generic Haskell, an extension of Haskell that supports generic programming, and/or a library for generic programming on problems like compression, (XML-) data bindings, diffing, etc.
The literature consists of Andres Löh's PhD thesis
, and a number of articles that will be distributed during the course.
In the first part of the course you will learn how to write generic programs in Generic Haskell and/or a generic programming library for Haskell. After the introductory lecture, you will develop a couple of generic programs in small groups, working closely together with the teacher. You can choose between different projects:
- a generic `exercise-assistant'. Students have started on this last year, and we will try to finish a first version this year. The groups will possibly work on a generic parser/printer, a generic rewriting module, and a generic treediff module. Other possibilities are logging analysis and interpretation, and strategies.
- a generic data migration tool, which given two data types, finds the cheapest way to convert data from one type to another type. This problem is for example interesting when an XML schema evolves.
- a tool for XML compression (started on by students last year).
While you work on the projects, you will see alternative approaches to generic programming, some theory behind generic programming, and more applications of generic programming.
A student will be graded by means of the project that will have to be handed in, and an exam at the end of the course. If the practical has been graded with p, and the exam with e, then the final grade will be (p+e)/2, provided p>5 and e>5.