Course Overview

What this OCaml course covers, how to use it, prerequisites.

A self-contained, hands-on course covering the OCaml language, its standard library, its module system, its advanced type system, multicore programming with effects, and the modern tooling ecosystem. Every chapter has runnable examples and exercises.

Course Map

Part I — Foundations Introduction to OCaml Installation & Tooling Setup

The Toplevel (REPL) and Your First Program Basic Types, Values & Operators Let Bindings, Scope & Immutability

Control Flow: Conditionals & Expressions Recursion & Tail Recursion Tuples, Lists & Pattern Matching

Type Inference, Annotations & Polymorphism Part II — Core Language & Standard Library Variants (Algebraic Data Types) Option & Result

Higher-Order Functions & the List Module Strings, Chars, Bytes, Buffer & Printf

Imperative Programming: refs, mutable fields, arrays, loops Standard Data Structures: Hashtbl, Map, Set, Stack, Queue, Seq Input / Output & Files Modules & Signatures Projects with Dune & opam Testing, Documentation & Debugging Part III — Advanced OCaml Advanced Pattern Matching

GADTs (Generalized Algebraic Data Types) Advanced Type System Features Advanced Module System Objects & Classes

Laziness, Memoization & Infinite Structures Monads, Applicatives & Binding Operators The Format Module & Pretty Printing Effect Handlers (OCaml 5)

Multicore: Domains, Atomics, Mutexes & Domainslib Concurrency: Lwt and Eio Metaprogramming with PPX Foreign Function Interface (C interop)

Memory Representation, the GC & Performance Compilation: Bytecode, Native, Flambda & Compiler Internals Part IV — Ecosystem & Real-World OCaml

Command-Line Apps (Arg, Cmdliner), Unix & Systems Programming JSON, S-expressions & Serialization

Web Development (Dream), Databases & HTTP OCaml in the Browser: js_of_ocaml, Melange, wasm_of_ocaml

Packaging & Publishing, Style & Best Practices Appendices: Cheat Sheet, Keywords, Operators, Resources