OCaml By Examples

Language Basics

Project Management

  • dune
  • dune-release
  • opam pin

Advanced Ocaml

  • functors
  • monads

Libraries

Compiling to javascript

console

...
$ opam install js_of_ocaml js_of_ocaml-compiler js_of_ocaml-ppx
$ dune build ./main.bc.js
$ node _build/default/main.bc.js
hello from js

dune

...
(executable
 (name main)
 (libraries)
 (modes js)
 (preprocess
  (pps js_of_ocaml-ppx)))
you've reached the end!