<quazimodo>
the '-nested' option is what i'm interested in
_whitelogger has joined #ocaml
narimiran has joined #ocaml
Jesin has joined #ocaml
aaaaaa has quit [Quit: leaving]
_whitelogger has joined #ocaml
_whitelogger has joined #ocaml
bartholin has joined #ocaml
bartholin has quit [Client Quit]
_whitelogger has joined #ocaml
osa1 has joined #ocaml
Tuplanolla has joined #ocaml
vicfred has quit [Quit: Leaving]
osa1 has quit [Ping timeout: 240 seconds]
ggole has joined #ocaml
snowpanda has quit [Quit: Leaving...]
snowpanda has joined #ocaml
snowpanda has quit [Quit: Leaving...]
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
Haudegen has joined #ocaml
artymort has joined #ocaml
narimiran has quit [Ping timeout: 240 seconds]
narimiran has joined #ocaml
artart78_ has joined #ocaml
JSharp_ has joined #ocaml
robmyers_ has joined #ocaml
artart78 has quit [Ping timeout: 240 seconds]
robmyers has quit [Ping timeout: 240 seconds]
SrPx has quit [Ping timeout: 240 seconds]
robmyers_ is now known as robmyers
JSharp has quit [Ping timeout: 240 seconds]
JSharp_ is now known as JSharp
SrPx has joined #ocaml
conjunctive has quit [Ping timeout: 240 seconds]
conjunctive has joined #ocaml
Duns_Scrotus has quit [Ping timeout: 240 seconds]
Duns_Scrotus has joined #ocaml
artart78_ is now known as artart78
artart78 has quit [Changing host]
artart78 has joined #ocaml
osa1 has joined #ocaml
narimiran has quit [Ping timeout: 265 seconds]
ggole- has joined #ocaml
zozozo_ has joined #ocaml
ggole has quit [Remote host closed the connection]
quazimodo has quit [Ping timeout: 240 seconds]
zozozo has quit [Ping timeout: 240 seconds]
quazimodo has joined #ocaml
sonologico has quit [Remote host closed the connection]
_whitelogger has joined #ocaml
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
sagax has joined #ocaml
zozozo_ has quit [Quit: WeeChat 2.9]
zozozo has joined #ocaml
waleee-cl has joined #ocaml
<quazimodo>
sorry for being a drama queen earlier, and probably again soon
<quazimodo>
i still haven't quite figured out how (i'm using opam and dune) to have a structured lib directory. I've made a gist with a basic idea of what I mean
<quazimodo>
given these files... how would I reference Controllers.Users from main.ml, for example. Would there even be a Controllers.Users or would we be doing something else
<d_bot>
<craigfe> You typically need `dune` files in every directory that contains code, so you'd need one in the root and one in `controllers/`
<d_bot>
<craigfe> Then `controllers/dune` defines a library with `(library ...)` that the root dune file depends on inside its corresponding `(libraries ...)` stanza
<d_bot>
<craigfe> (at that point, the definitions of `controllers/users.ml` are referenced by `Controllers.Users` as you suggest)
<d_bot>
<rgrinberg> Be careful of doing it this way however. You will make it very easy to introduce circular dependencies which OCaml forbids. Another option is to to use `(include_subdirs unqualified)` and forego the pretty names.
<quazimodo>
im not sure how to reply to each of you separately
<quazimodo>
craigfe: and what happens when you have something like Controllers.Api.V1.Users
<quazimodo>
with the path being controllers/api/v1/users.ml
<quazimodo>
same thing, dune will allow?
<quazimodo>
rgrinberg: I'm trying to understand how do you structure a project with a team of 10 devs and many nested parts/concerns
<quazimodo>
rgrinberg: do you expect everything to be super flat?
narimiran has joined #ocaml
<d_bot>
<craigfe> quazimodo: The fundamental unit of shared code w.r.t. Dune is a library, which is expected to exist in a single directory. rginberg's suggestion of `(include_subdirs unqualified)` effectively causes Dune to see all files in the subtree as being part of the same directory, and so it works if all you care about is your FS structure, but does not reflect that FS structure in the namespacing of modules in the code.
<d_bot>
<EduardoRFS> Not rgrinberg, but being flat is always a good idea
<d_bot>
<craigfe> quazimodo: If you want to reflect arbitrary FS structure as nesting of module namespaces, you need to manually specify Dune rules that make it so. (In this case, `api/v1/dune` might define a `controllers-api.v1` library, for instance, which would then be re-exported as part of a parent library.) OCaml projects tend not to be structured this way, preferring a combination of the namespacing tools that exist in the language and mult
<d_bot>
<craigfe> If you want an example of a large Dune repository, https://gitlab.com/tezos/tezos/ does this. (although it has its own idiosyncrasies)
<d_bot>
<craigfe> Another example would be Dune itself.
<d_bot>
<craigfe> Both of these go the route of `src/<library>/*.ml` with more granular namespacing reflected in the code rather than the file-system.