OCaml By Examples

Language Basics

Project Management

  • dune
  • dune-release
  • opam pin

Advanced Ocaml

  • functors
  • monads

Libraries

Setup

console

Install **opam**, the version management and package manager of OCaml. You can also consult the [official opam webpage](https://opam.ocaml.org/doc/Install.html).
$ sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
...
In all of these examples, you will need to **replace** the standard library of OCaml with the well-accepted standard library replacement of Janestreet: **`Core`**. To consult the documentation of any packages (including `Core`), refer to the [ocaml docs](https://docs.ocaml.pro/).
$ opam install core
...
Sometimes, things won't work if you don't set some PATHs via this command.
$ eval $(opam config env)
next: Hello World