Course description

Contents

This course introduces functional programming through the programming language Haskell. In contrast with the language C# – introduced in Imperatief/Game/Mobiel programmeren – which is based on statements, organized in methods and classes, functional programming is based entirely on expressions and functions. This shifts the focus from how a program operates to what is does.

Concrete topics treated in this course include higher-order functions, parametric and ad-hoc polymorphism (also known as generics and overloading in other programming languages), algebraic data types and pattern matching. These ideas appear not only in Haskell, but in other modern languages such as Scala, Swift or Kotlin. An important part of the course is devoted to reasoning about programs, either by equations or by induction.

The language Haskell imposes a strong separation between pure computations and those with side-effects, such as input and output. Monads are introduced to model the idea of sequential computation in a functional language. Similar abstractions such as functors are also part of the contents of this course.

Literature

Schedule

The load per week is 2 × 2 h. lectures, 1 × 2 h. practicals and 1 × 2 h. werkcollege. Attendance is not strictly mandatory (albeit recommended). Please attend the group according to this assignment (username/password: fp).

Assignments

There are two kinds of mandatory assignments:

In addition to those mandatory assignments, there is an optional assignment to be made in groups to get some extra points in the grade. The assignment involves exploring and presenting some language extension or Haskell library.

Grading

The final grade depends on the two exams and the assignments.

The final grade is computed as F = min( 0.5 × T + 0.5 × P + 0.05 × O, 10 ). The final result of the course is: