IIT Madras · Computer Science

Functional Programming with OCaml

Prof. K C Sivaramakrishnan · 73 free video lectures

This course introduces the principles of functional programming using OCaml, with a strong emphasis on building reliable and secure software systems. It covers core concepts such as higher-order functions, type systems, and modular design, along with advanced topics like concurrency and memory…

▶ Play on Open Lecture HallCourse page ↗

Lectures

  1. Course introduction: what you'll learn, how it's run
  2. Why functional programming?
  3. A tour of OCaml: values, types, and the toplevel
  4. Your first OCaml program: hello, world (and beyond)
  5. Tutorial: temperature conversions and small expressions
  6. Literals: integers, floats, booleans, strings
  7. `let` bindings and shadowing
  8. Static vs dynamic semantics, and type inference
  9. Operators, precedence, and common pitfalls
  10. `if`/`then`/`else` as an expression
  11. Tutorial: small expressions, end to end
  12. Functions as values, and anonymous functions
  13. Recursion
  14. Currying and partial application
  15. Tail recursion and accumulators
  16. Local functions and mutual recursion
  17. Tutorial: Fibonacci, GCD, power, digits
  18. Tuples
  19. Records
  20. Variants (sum types)
  21. Recursive types: lists, trees, expressions
  22. Tutorial: a tiny AST for OCaml
  23. Tutorial: a tiny file system
  24. Basic patterns: literals, variables, wildcards
  25. Pattern matching on lists and trees
  26. Nested patterns and or-patterns
  27. Guards: when-clauses on patterns
  28. Exhaustiveness checking
  29. Tutorial: an interpreter for the OCaml AST
  30. Functions as values, revisited
  31. map: transform every element
  32. filter: keep what passes the predicate
  33. fold: reduce a list to a single value
  34. Function composition and pipelines
  35. Tutorial: fold across data structures
  36. Mutable references
  37. Mutable records and arrays
  38. Exceptions
  39. Streams and Laziness
  40. Memoization
  41. Module basics
  42. Module signatures
  43. Functors
  44. Tutorial: A Queue functor
  45. The option monad and `let*`
  46. Monad laws, the list monad, and the result monad
  47. The state monad and parameterised state
  48. GADTs: variants with type-level information
  49. GADTs: use cases beyond toy interpreters
  50. GADTs: hlists and witnesses
  51. Tutorial: a tiny well-typed evaluator
  52. Why test a type-safe program?
  53. Specifications and invariants
  54. Designing test cases: black-box and glass-box
  55. Unit testing
  56. Property-based testing with QCheck
  57. Model-based testing of stateful data structures
  58. Tutorial: testing the expr evaluator with OUnit2 and QCheck
  59. What memory safety is, and why it is a security story
  60. Memory safety by construction
  61. Data races are undefined behaviour
  62. Where OCaml itself has UB
  63. Tutorial: walking Heartbleed end to end
  64. Locality: safe stack allocation
  65. Uniquenss: the only reference
  66. Linearity: use at most once
  67. Contention: Synchronisation at compile time
  68. Portability: data race freedom across domains
  69. Tutorial: a resource-management API
  70. Why do we need an OS?
  71. MirageOS Unikernel Background
  72. MirageOS Basics
  73. Suresh the Stationmaster: a worked unikernel example

From NPTEL (IITs and IISc) · CC BY-NC-SA. More from IIT Madras.

Open Lecture Hall is free, with no ads and no sign-up. It is not run by or connected to any university; the lectures are the universities' own free recordings, played from where they host them. About & rights