News for hackers. Stuff that matters.
Re:From dependency injection to dependency rejection by daxfohl on Sunday February 05, 2017 @04:50AM (#13571649)
Out of curiosity, OCaml also has traditional classes/interfaces/objects, right? If so, then how do you decide when to use those versus module functors?
Re:From dependency injection to dependency rejection by yawaramin on Sunday February 05, 2017 @12:12PM (#13573295)
Modules and functors are able to contain type definitions, while classes/objects are not. This makes modules practically much more useful for abstraction.
Re:From dependency injection to dependency rejection by willtim on Sunday February 05, 2017 @05:21AM (#13571720)
AFAIK no one uses Objects in OCaml as the module system is sufficiently powerful. The Mirage project is a good example of using OCaml module functors to specialise components.