Lessons
OCaml · Easy
OCaml · Easy. 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
Polymorphism and type variables
'a in signatures, generic functions, and how inference generalizes.

Lesson 2
Pipelines with |> and @@
Reverse application, function composition, and readable data pipelines.

Lesson 3
Labeled and optional arguments
~label arguments, ?optional with defaults, and why a unit argument ends them.

Lesson 4
Exceptions
raise, try ... with, defining exceptions, Not_found, and Fun.protect cleanup.

Lesson 5
Pattern matching in depth
Guards with when, or-patterns, as-bindings, nested patterns, and function sugar.

Lesson 6
Printf and string handling
Printf.printf/sprintf format specs, String functions, and Buffer basics.

Lesson 7
Hashtbl and Map
Mutable Hashtbl, immutable Map.Make, and choosing between them.

Lesson 8
The result type
Ok and Error, Result.bind, and errors as values with explicit types.

Lesson 9
Lazy sequences with Seq
Seq.t, on-demand generation, Seq.take, and converting from lists.

Lesson 10
Modeling with types
Making illegal states unrepresentable with variants and records.
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.