Content:

This course offers a rigorous and hands-on introduction to the principles and practice of functional programming—an increasingly influential paradigm that underpins the development of reliable, maintainable, and secure software.

Functional programming centers on the use of pure functions: self-contained computations that produce outputs without altering external state. This absence of side effects leads to code that is not only elegant and expressive but also inherently more predictable and easier to reason about than traditional imperative code. As a result, functional programming is particularly well-suited for building security-critical systems, where correctness and robustness are paramount.

The course uses OCaml, a modern functional language, to explore the theory and practice of functional programming from the ground up. Students will learn how strong static typing and advanced type systems serve as powerful tools for writing safe, composable, and error-resistant programs.

Through a mix of lectures, interactive exercises, and extended case studies (including the design and implementation of a small programming language), students will gain a deep understanding of how functional languages work and why they matter. These skills translate seamlessly to many modern mainstream languages, which increasingly incorporate functional concepts.

In addition to mastering practical programming techniques, students will also learn to reason formally about program correctness—an essential competency for those aiming to build high-assurance systems. By the end of the course, students will be equipped not just to write functional programs, but also to argue about their security and correctness.

Learning Outcomes:

After successful completion of this course, students will:

  • develop programs in high-level, functional programming languages, in particular OCaml
  • understand and apply the use of recursion to define data structures (lists, maps, trees, etc.) and purely functional algorithms
  • understand the structure and advantages of type systems and use them to support program design and implementation
  • study advanced functional programming features, including type polymorphism and higher-order functions
  • reason informally about the correctness and efficiency of functional programs and be aware of more formal alternatives to reasoning
  • apply type abstraction and modularization to structure programs into collections of libraries and use those to build more complex programs on top of them
  • argue about the correctness and security of functional programs
  • understand the fundamental principles of programming language design, especially applied to functional programming
  • design and develop simple programming languages, covering their formal definition and subsequent implementation as interpreters

Exam:

Written final module examination (120 minutes)

Semester: WT 2025/26