OCaml

Join the OCaml Track
OCaml is a functional and object-oriented language, used both in industry and as a teaching language to elegantly solve problems. The strong type system, with type inference, is useful for catching mistakes.
Join the OCaml Track
Track mentors

2 Mentors

Our mentors are friendly, experienced OCaml developers who will help teach you new techniques and tricks.
Track students

597 Students

Join hundreds of students who have enjoyed learning and improving their skills by taking this track.
Track exercises

43 Exercises

Hundreds of hours have gone into making these exercises fun, useful, and challenging to help you enjoy learning.

About OCaml

let rec fib = function
  | 0 -> 1
  | 1 -> 1
  | n -> fib (n - 1) + fib (n - 2)

OCaml is an industrial strength programming language supporting functional, imperative and object-oriented styles - but don't worry if you're not familiar with these, as it's used as a teaching language by a lot of institutions (including Cornell and Princeton).

One of the best features of OCaml is the rich and powerful type system - this is useful to catch some mistakes early on saving developers a huge amount of frustration. Also, type inference relieves developers from having to specify types in the code - the compiler will work these out for you!

It's used by Facebook (for static code analysis with Infer) and Jane Street (for providing strong guarantees for their internal trading systems), and has influenced the F# functional programming language and ReasonML.

Join the OCaml track

A tremendous learning opportunity to explore the depth of your own knowledge

Exercism is fantastic in learning new languages but that is not the extent of it. If you are a "more experienced" programmer you may have encountered impostor syndrome: the idea you don't really know what you think you know. Exercism lets you solve problems and put them in the space of open feedback which is a tremendous learning opportunity to explore the depth of your own knowledge. Even if you have been programming in a language for awhile it is worth checking into Exercism to see where you stand with current implementation practices.

Relaxed. Encouraging. Supportive.

Meet the OCaml Track mentors

Once you join the OCaml language track, you will receive support and feedback from our team of mentors. Here are the bios of a few of the mentors of this track.

Avatar of Simon Shine

Simon Shine https://simonshine.dk

I've been a classroom teacher in compilers and various functional languages for five years. Having pure functions and isolation of side-effects are fundamental to separation of concerns. Strong, static types, type inference and algebraic types are hard for me to live without.
Avatar of Stephen Bastians

Stephen Bastians https://github.com/stevejb71

I like OCaml's approach of being functional first, but allowing for escape hatches into imperative code when you really need them.
Fun. Challenging. Interesting

Community-sourced OCaml exercises

These are a few of the 43 exercises on the OCaml track. You can see all the exercises here.

Rectangles
medium
search
Say
medium
strings
All Your Base
medium
math
Prime Factors
medium
algorithms
math
React
hard
reactive programming
Atbash Cipher
medium
transforming
Passionate. Knowledgeable. Creative.

Meet the OCaml Track maintainers

The OCaml Maintainers are the brains behind the OCaml Track. They spend their spare time creating interesting and challenging exercises that we can all learn from. We are incredibly grateful for their hard work. Here are the bios of a few of the maintainers of this track.

Avatar of Simon Shine

Simon Shine https://simonshine.dk

I've been a classroom teacher in compilers and various functional languages for five years. Having pure functions and isolation of side-effects are fundamental to separation of concerns. Strong, static types, type inference and algebraic types are hard for me to live without.

Get started with the OCaml track. As with everything on Exercism, it's 100% free!

Join the OCaml Track