OPAM

opam is a source-based package manager for OCaml. It supports multiple simultaneous compiler installations, flexible package constraints, and a Git-friendly development workflow.

Workflow

Initialize OPAM

  opam init --bare -a -y

Update OPAM

  opam update

Switches

A switch is a named installation of OCaml with a particular compiler version and set of packages. You can have many switches and, well, switch between them - whence the name. (Clarkson 2025, 11)

References:

Clarkson, Michael Ryan. 2025. Ocaml Programming: Correct + Efficient + Beautiful. https://cs3110.github.io/textbook/.

Backlinks: