Jump to the current lecture

This is a course on Functional Programming in OCaml. It focuses on functional programming ideas, rather than pragmatic OCaml programming. Lectures 1 to 6 may appear overwhelming as they introduce many concepts. In fact, the algorithmic content of lectures 1–6 is for the most part quite simple, but I wanted them to force the students to think from scratch. Concepts from lectures 7, 8, 10 are more prevalent in Haskell, because OCaml programmers can judiciously use imperative features to avoid introducing complexity. In particular, monadic programming has better optimization support in Haskell than in OCaml. Lecture 9 (and lectures 12, 14 to come) address the pragmatics of OCaml programming directly. To be a well-rounded functional programmer, you should also complete a complementary course based on the book Pearls of Functional Algorithm Design by Richard Bird. Or you can intersperse reading Pearls of Functional Algorithm Design with following this course. (Perhaps I’ll do something about it.)

Initial lectures have examples translated to F#, but then I decided to focus on OCaml.

Useful links:

Functional programming video lectures:

Lectures and assigned material

The time given is how many lecture-hours a lecture actually took us, for reference: don’t be scared that lecture 6 appears as a single lecture. One meeting is two lecture-hours.

Contact me if you would like to receive our exam exercise sets. They are based in half on 99 problems.

Working in the browser:

Installing on a desktop:

The instructions below are outdated. Go to ocaml.org / Install OCaml if you do not have OCaml working yet.

Installing on Windows:

Installing on Debian-derived systems (e.g. Ubuntu):