Learn how to install OCaml locally to solve Exercism's exercises on your own machine
To work on the exercises, you will need these pieces of software:
OPAM
, the OCaml Package manager
See Real World Ocaml, 2nd Ed.: Installation Instructions
for how to install and configure OPAM
for your operating system.
The OCaml compiler
See a list of available versions:
opam switch
Switch to that version. If, for example, the latest version is 4.08.0, you will run:
opam switch 4.08.0
Install extended standard libraries and test libraries
Some exercises use only the OCaml standard library, and some use the extended libraries by Jane Street called Base and Core_kernel.
The test library is called OUnit, and some exercises additionally use the QCheck library for property-based tests.
opam install base core_kernel ounit qcheck
Install and use interactive shell
A summary of Setting up and using utop
:
opam install utop
Place the following in the file .ocamlinit
in your home directory should contain something like:
#use "topfind";;
#require "base";;
open Base