3 ms·
Most likely because there is plenty of actual production code using modules written in Ocaml and modules are such a key part of modern idiomatic Ocaml no one se
by brmgb 9y ago
Most likely because there is plenty of actual production code using modules written in Ocaml and modules are such a key part of modern idiomatic Ocaml no one seems to think that writing blog posts and exemples outside of teaching material is interesting. Ocaml users are generally more interested into writing software than promoting the language.
You will find plenty of exemples in the Ocaml manual (the whole chapter 2 is on the module system [1]) and beginner focused books however (chapter 4, 9 and 10 of Real World Ocaml [2]).
Functors (parametrized modules) are routinely used in production Ocaml code. Ocamlgraph [3] is a famous exemple (it's used by Frama-C and pff) because they wrote a paper on using functors to build generic library in 2007 [4] but they are literally everywhere : Janestreet Core, Facebook pff, Facebook infer, Frama-C.
[1] http://caml.inria.fr/pub/docs/manual-ocaml/moduleexamples.html http://caml.inria.fr/pub/docs/manual-ocaml/moduleexamples.ht...
[2] https://dev.realworldocaml.org/toc.html https://dev.realworldocaml.org/toc.html
[3] http://ocamlgraph.lri.fr/index.en.html http://ocamlgraph.lri.fr/index.en.html
[4] http://www.lri.fr/~filliatr/ftp/publis/ocamlgraph.ps http://www.lri.fr/~filliatr/ftp/publis/ocamlgraph.ps