OCaml
Full course · 21 lessonsOCaml is a functional, imperative, and object-oriented language from the ML family. It excels at type-safe systems programming, formal verification, and high-assurance software with a powerful module system and type inference.
Getting Started with OCaml
OPAM, utop, and hello world.
Values and Types
let bindings and basic types.
Functions
Higher-order functions and currying.
Lists
Immutable linked lists.
Pattern Matching
Destructure data safely.
Option Types
Represent optional values.
Records
Named field structures.
Variants
Sum types for data modeling.
Modules and Signatures
Encapsulate code with modules.
Recursion and Tail Calls
Recursive definitions.
Imperative Features
Refs, arrays, and mutable state.
Exceptions
Raise and handle errors.
Functors
Modules parameterized by modules.
Advanced Types
GADTs and polymorphic variants.
Input/Output
File and console IO.
Objects and Classes
OCaml object system.
Concurrency with Lwt
Cooperative threads for IO.
PPX and Metaprogramming
Syntax extensions.
Testing with Alcotest
Unit and property tests.
Dune Build System
Build and manage OCaml projects.
Ecosystem and Next Steps
Libraries, tooling, and community.
Free Books
OCaml from the Very Beginning
A zero-prerequisites beginner book backed by the OCaml Software Foundation — free to read online or download as PDF.
Real World OCaml (2nd Edition)
The definitive intermediate-to-advanced resource covering real-world apps, platform toolchain, and ecosystem libraries.
OCaml Programming: Correct + Efficient + Beautiful
Cornell CS 3110 open textbook emphasizing semantics, data structures, and testing in OCaml.

