Thanks @jerben I’ll check out functoria and Sihl, just trying to understand the general patterns at use in OCaml as well
I really liked this:
On a more serious note, originally we wanted to collect a set of services, libraries, best practices and architecture to quickly and sustainably spin-off our own tools and product.
since as someone evaluating OCaml at the moment - I find it difficult compared to other ecosystems to dive in and be productive, patterns and workflows people are using seem to be a bit hidden (for example another basic problem I couldn’t find an existing answer to: OCaml web server run multiple processes - #2 by roddy )
I suspect that dependency injection is a bit heavier and clunkier in OCaml with modules compared to typical OOP approaches. In turn I get to use OCaml everywhere else, including my business logic. Seems to be a good trade to me.
fair point, what I mean is - what is the disadvantage of using objects and classes in OCaml, vs modules
for example the post above shows the same DI implemented with both classes Sketch.sh - Interactive ReasonML/OCaml sketchbook and modules Sketch.sh - Interactive ReasonML/OCaml sketchbook , both in OCaml.
What I’m trying to figure out is what is the distinct advantage of using the module system as opposed to the objects one?
The module system is the one that is generally preferred in the community, so there must be a reason, but my question is - what is it (don’t want to follow a trend blindly without understanding the pros and cons)?