Lessons
OCaml · Introductory
OCaml · Introductory. Ten lessons. Open-book quizzes. Lesson 1 free.
10 lessons · The Host · Lesson 1 free
Pass all ten lessons for the certificate. Sample · Claim

Lesson 1 · On the house
Hello OCaml
print_endline, let () =, comments, utop, and ocaml or dune to run.

Lesson 2
Values and types
int, float, string, bool, char; separate float operators; type inference.

Lesson 3
let bindings and functions
let and let ... in, function definitions, currying, and partial application.

Lesson 4
if, match and recursion
if/then/else expressions, recursive functions with let rec, and simple match.

Lesson 5
Lists
List literals, :: cons, pattern matching on lists, and List.map/filter/fold_left.

Lesson 6
Tuples and records
Tuples with fst/snd and destructuring, record types, fields, and with-updates.

Lesson 7
Variants
Sum types with constructors, data on constructors, and exhaustive matching.

Lesson 8
Option instead of null
Some/None, matching options, Option.value, and List.find_opt.

Lesson 9
Imperative features
ref cells, arrays, for and while loops, and sequencing with ;.

Lesson 10
Modules and dune projects
Files as modules, module access with dots, open, and a dune build.
Sample certificate
Certificate of completion
Sign in to claim your certificate of completion.
Certificate
Finish all ten lessons, then sign in
Pass every lesson on this device (quizzes and checks). Then sign in or create an account to type your name and download the JPG.