Learning
Why OCaml?
Beginner
- The Beginners' Guide to OCaml Beginners
- Learn X in Y minutes where X=OCaml.
- Functional Programming with OCaml
Advanced
Polymorphism
Monads
Articles
- Python to OCaml: retrospective
- Xen – OCaml Coding Considerations
- A blog about game development in OCaml
- (Functional) Alternatives to inheritance
- Higher-Rank Polymorphism in OCaml
- mikmatch – OCaml pattern-matching extended with regexps
- Inlined records in constructors
- Algebraic Data Types
- A safe but strange way of modifying OCaml compiler
- Fiddling with the OCaml Type System
Best Practices
See best-practices
Exercises
- 99 problems. 99% solutions are here.
- Rosetta Code
- OCaml at Exercism – Exercism is your place to engage in thoughtful conversations about code. Explore simplicity, idiomatic language features, and expressive readable code. Solutions.
Books
- Real World OCaml by Y. Minsky, A. Madhavapeddy and J. Hickey - Functional programming for the masses. The latest, and arguably the most readable book on OCaml. Note that the book uses only Jane Street libraries, but the material can be applied to other libraries.
-
- RWO-lwt: translating the Async code examples from Real World OCaml to lwt.
-
- More OCaml: Algorithms, Methods, and Diversions – In More OCaml John Whitington takes a meandering tour of functional programming with OCaml, introducing various language features and describing some classic algorithms. The book ends with a large worked example dealing with the production of PDF files. There are questions for each chapter together with worked answers and hints.
- How to Think Like a (Functional) Programmer by Allen Downey and Nicholas Monje – How to Think Like a Computer Scientist is an introductory programming textbook based on the OCaml language. It is a modified version of Think Python by Allen Downey. It is intended for newcomers to programming and also those who know some programming but want to learn programming in the function-oriented paradigm, or those who simply want to learn OCaml.
- OCaml from the Very Beginning by J. Whitington - OCaml from the Very Beginning will appeal both to new programmers, and experienced programmers eager to explore functional languages such as OCaml.
- Pearls of Functional Algorithm Design by Richard Bird - It summaries 30 hard algorithm problems in function programming world. Although it is for Haskell, the algorithm problems are very interesting and trying to solve them in OCaml also helps the thinking of functional programming. Partial solutions in OCaml are here.
- Unix System Programming in OCaml by X. Leroy and D. Rémy – Introduction to Unix system programming, with an emphasis on communications between processes.
- Using, Understanding, and Unraveling OCaml – This book describes both the OCaml language and the theoretical grounds behind its powerful type system.
- Purely Functional Data Structures: A classic book focusing on various data structures in the functional programming world. Can be very useful for understanding functional data structures, though OCaml obviously supports imperative data structures as well.
- OCaml for Scientists - by Jon Harrod.
Online Courses
- Introduction to Functional Programming in OCaml.
- Cornell University – Data Structures and Functional Programming.
- Princeton University - Functional programming in OCaml.
- University of Illinois - Course that uses OCaml to teach functional programming and programming language design