Functional Programming with OCaml
A 12-week NPTEL course. Pick a lecture below, or start at Module 1, Lecture 1. To take the course for credit (assignments, proctored exam, certificate), sign up on the NPTEL portal.
M01
Intro to functional programming
M02
Expressions
M03
Functions
M04
Data types
M05
Pattern matching
M06
Higher-order programming
- L01 Functions as values, revisited
- L02 `map`: transform every element
- L03 `filter`: keep what passes the predicate
- L04 `fold`: reduce a list to a single value
- L05 Function composition and pipelines
- L06 Tutorial: fold across data structures
- L07 Practice: recursion, higher-order functions, and syntax trees
M07
Side effects and modular programming
- L01 Mutable references
- L02 Mutable records and arrays
- L03 Exceptions
- L04 Streams and laziness
- L05 Memoization
- L06 Module basics
- L07 Module signatures
- L08 Functors
- L09 Tutorial: a queue functor
- L10 Practice: mutability, modules, and streams
M08
Monads and GADTs
- L01 The option monad and `let*`
- L02 Monad laws, the list monad, and the result monad
- L03 The state monad and parameterised state
- L04 GADTs: variants with type-level information
- L05 GADTs: use cases beyond toy interpreters
- L06 GADTs: hlists and witnesses
- L07 Tutorial: a tiny well-typed evaluator
- L08 Practice: monads and GADTs
M09
Testing
M10
Memory safety and security
M11
OxCaml: type-level extensions of safety
M12
Unikernels (MirageOS)
Dune playground · Privacy & data collection · Quiz analytics dashboard