2 ms·
I'm not aware of any particular document, know. I have just read the language spec for modules. I know that sounds scary but, IMO, it's very approachable. An
by sausagefeet 4y ago
I'm not aware of any particular document, know. I have just read the language spec for modules. I know that sounds scary but, IMO, it's very approachable. And then, I think you just need to play with it to get a feel for me. But maybe someone else has a better introduction. But I think typeclasses and traits are about polymorphism, and that isn't what modules are about, they are about encapsulating code.
https://v2.ocaml.org/releases/4.14/htmlman/modtypes.html https://v2.ocaml.org/releases/4.14/htmlman/modtypes.html
https://v2.ocaml.org/releases/4.14/htmlman/modules.html https://v2.ocaml.org/releases/4.14/htmlman/modules.html
https://v2.ocaml.org/releases/4.14/htmlman/firstclassmodules.html https://v2.ocaml.org/releases/4.14/htmlman/firstclassmodules...