By the end of the course you will be able to
- solve problems using a ‘functional approach’. That is, define what needs to be computed using techniques and concepts such as
- pattern matching,
- higher order functions,
- algebraic data types,
- immutable and persistent data structures, and
- reason about the correctness and the types of functions.
- develop a small, real world game in the functional language Haskell.
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.
Attendance is not strictly mandatory (albeit recommended).
- 2 × 2 hours lectures
- 1 × 2 hours practicals
- 1 × 2 hours group tutorials
- Slides from the lectures
- Mandatory reading: "Programming in Haskell" by Graham Hutton
- Additional material:
- Lecture Notes from 2015/2016
- "Learn You a Haskell for Great Good" by Miran Lipovača
- Haskell Wikibook