Learn-OCaml
Solve OCaml exercises in a web editor with a built-in toplevel and lessons
Most of the 141 exercises on the public instance (its exercise index on 30 November 2026) come out of university teaching. The biggest block, 59 by Simão Melo de Sousa, covers types and errors, calculations and recursion, and lists and vectors. The 37 from the Introduction to Functional Programming MOOC go week by week from integer and string identifiers through tries, first-class functions, exceptions, arrays and module signatures, then close with two projects: a Klotski solver and a random text generator. One week-five exercise is titled Unraveling the Automatic Grader.
Free · Browser · Beginner

About Learn-OCaml
Every exercise carries one to three stars. Hugo Férée's 20 are the gentlest way in, starting with local declarations and booleans, while all 25 of François Pottier's advanced problems sit at three stars, with titles such as Alpha-Beta Search and Breaking a Sort.
In a Hacker News thread about the demo (203 points), several commenters said it drills rather than teaches. One found an early exercise closer to a maths puzzle than a lesson. Others noted that it assumes you are following another resource, and one explained that the framework was built to accompany lectures.
OCamlPro wrote the platform between 2015 and 2018 on top of the older Try OCaml, using js_of_ocaml to run OCaml in the browser.
Questions about Learn-OCaml
Can a teacher run Learn-OCaml for a class?
Can I contribute an exercise to the public set?
Made this game? Claim it →

Tips and discussion
No tips yet.
Sign in to share a tip.