adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.07.1 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.07/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml | Due to ongoing spam, you must register your nickname to talk on the channel
Haudegen has quit [Ping timeout: 245 seconds]
picolino has quit [Ping timeout: 258 seconds]
andrewlitteken has quit [Quit: Connection closed for inactivity]
Guest35955 has quit [Remote host closed the connection]
jao has joined #ocaml
AtumT_ has quit [Quit: AtumT_]
ale64bit has joined #ocaml
pierpal has joined #ocaml
djellemah has joined #ocaml
silver has quit [Read error: Connection reset by peer]
DomTorr__ has joined #ocaml
jao has quit [Ping timeout: 258 seconds]
DomTorr_ has quit [Ping timeout: 245 seconds]
oni-on-ion has quit [Remote host closed the connection]
ale64bit has quit [Ping timeout: 246 seconds]
oni-on-ion has joined #ocaml
mfp has quit [Ping timeout: 258 seconds]
oni-on-ion has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 258 seconds]
djellemah has quit [Ping timeout: 245 seconds]
djellemah has joined #ocaml
djellemah has quit [Client Quit]
gravicappa has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
lostman has quit [Quit: Connection closed for inactivity]
xuib has joined #ocaml
Haudegen has joined #ocaml
Redfoxmoon has quit [Ping timeout: 245 seconds]
barockobamo has joined #ocaml
freyr69 has joined #ocaml
sodastab has quit [Ping timeout: 250 seconds]
Niamkik has quit [Ping timeout: 245 seconds]
ollehar has joined #ocaml
xuib has quit [Quit: xuib]
freyr69 has quit [Remote host closed the connection]
Birdface has joined #ocaml
klntsky has quit [Ping timeout: 256 seconds]
klntsky has joined #ocaml
freyr69 has joined #ocaml
tg has quit [Ping timeout: 245 seconds]
mfp has joined #ocaml
tg has joined #ocaml
ShalokShalom has joined #ocaml
Haudegen has quit [Remote host closed the connection]
ShalokShalom has quit [Ping timeout: 258 seconds]
Haudegen has joined #ocaml
Fardale has quit [Ping timeout: 250 seconds]
Fardale has joined #ocaml
zolk3ri has joined #ocaml
silver has joined #ocaml
kakadu has joined #ocaml
Birdface has quit [Ping timeout: 252 seconds]
tane has joined #ocaml
jao has joined #ocaml
okhra has joined #ocaml
okhra has quit []
spew has joined #ocaml
Redfoxmoon has joined #ocaml
Redfoxmoon has quit [Changing host]
Redfoxmoon has joined #ocaml
ygrek_ has joined #ocaml
AtumT has joined #ocaml
jao has quit [Remote host closed the connection]
freyr69 has quit [Remote host closed the connection]
ollehar has quit [Ping timeout: 244 seconds]
jao has joined #ocaml
Haudegen has quit [Remote host closed the connection]
ziyourenxiang has quit [Ping timeout: 268 seconds]
Netsu has joined #ocaml
<Netsu> Hi. I have minor question about dune project organization. Is it proper place to ask?
<companion_cube> sure, ask, don't wait for someone to give you permission
<Netsu> Actually I created an issue https://github.com/ocaml/dune/issues/2156 because can't find answer in documentation and exist projects.
<companion_cube> you'd like some files to be module types?
<Netsu> I would like to have some module types in library top level
<companion_cube> well you can have a file `m.ml` where you do this sort of things
<companion_cube> (if the library is called m)
<Netsu> e.g. MyLib.Nested : MyLib.NESTED
<companion_cube> https://dune.readthedocs.io/en/latest/dune-files.html#library <--- you can write an explicit module M and control what it exposes
<Netsu> companion_cube: but wouldn't be I forced then to list each submodule in m.ml explicitly by hand?
<companion_cube> yes
<Netsu> companion_cube: sorry, 'yes' meen I would be forced?
<companion_cube> yes
oni-on-ion has joined #ocaml
<Netsu> companion_cube: in big project it could lead to lots of boilerplate, sad
<companion_cube> I guess dune could be extended to do that for .mli only files, maybe
<companion_cube> it's just that it apparently wasn't an urgent use case until now
<Netsu> companion_cube: it could be enough maybe (mli, I mean). Any examples?
<Netsu> I see strange *.boot.ml here https://github.com/ocaml/dune/tree/master/src/wp but can't understand, how it work
<oni-on-ion> ahh! reminds me of when i had to make *.hs.boot for haskell . ocaml modules seem to solve this
<Netsu> modules are ok. Dune not (yet).
<companion_cube> afaik packs didn't allow you to do this either
<oni-on-ion> maybe dune can be set up better? i had trouble with it at first
<Netsu> companion_cube: opam packages? Why not, it's just code generation phase by dune. At the end it would be plain list of prefixed modules, I guess. Like module_without_implementation ones
jmiven has quit [Quit: co'o]
jmiven has joined #ocaml
<companion_cube> no, I meant ocaml -pacl
<companion_cube> pack
<companion_cube> the old way of doing these multi files modules
<Netsu> I'm too noob for that
jao has quit [Remote host closed the connection]
<Netsu> but maybe it could be hacked by dune's 'rule'
<companion_cube> just write the file by hand…
Haudegen has joined #ocaml
Serpent7776 has joined #ocaml
sodastab has joined #ocaml
sodastab has quit [Excess Flood]
sodastab has joined #ocaml
sodastab has quit [Excess Flood]
sodastab has joined #ocaml
Jesin has quit [Quit: Leaving]
<oni-on-ion> how can i export a module ?
<oni-on-ion> ie. if an (executable) uses a (library) which has (modules)
barockobamo has quit [Remote host closed the connection]
barockobamo has joined #ocaml
<companion_cube> the library exports the modules
<oni-on-ion> hmm not working at all for any modules
<oni-on-ion> would it matter if its (exe) -> (library) -> (library) ? the last one with modules
<oni-on-ion> so confuse
Jesin has joined #ocaml
barockobamo has quit [Remote host closed the connection]
barockobamo has joined #ocaml
<oni-on-ion> hmm nope. i dont understand how to access modules from a libary
<oni-on-ion> i don't get it. i am stuck, nothing is working; i see no point in libraries now
<octachron> What are you trying? Did you remember that library are wrapped by default?
barockobamo has quit [Ping timeout: 258 seconds]
<octachron> i.e., if you have a module A in a library lib, dune exports it as Lib.A by default
Jesin has quit [Quit: Leaving]
<oni-on-ion> my project dir "tools" is the library, which i intend to be used by the sub dirs "app1" , "app2"
<oni-on-ion> i think dune wants me to have it the other way around, ie app1 -> [tools] , app2 -> [tools] which is the opposite of what i want, because [tools] is shared between the apps.
okuu has quit [Quit: ERC (IRC client for Emacs 26.2)]
Jesin has joined #ocaml
<octachron> If you want to use tools in app1, you just need to add tools in the list of library dependencies of app1: e.g. (libraries (tools ...))
<oni-on-ion> yep, its there; thats why im stuck
<oni-on-ion> very small setup, tools/dune = (library (name tools) (modules ...A)) app1/dune = (executable (name app1) (libraries tools)) ..... unbound module 'A'
<oni-on-ion> (from app1/app1.ml )
<octachron> You need to use Tools.A
<oni-on-ion> there must be something i am overlooking in this trivial
<oni-on-ion> tried, will try again
<oni-on-ion> yep nope
<oni-on-ion> hmmmm.
<oni-on-ion> do i need .mli files ?
<companion_cube> no, they're just good practice
kakadu has quit [Quit: Konversation terminated!]
<octachron> another potential issue, do you happen to have a module named tools.ml in tools?
<oni-on-ion> companion_cube, ok. will get there =)
<oni-on-ion> octachron, yep !
<companion_cube> then you need to export A from it
<companion_cube> module A = A
jao has joined #ocaml
<oni-on-ion> i've moved tools.ml instead
<oni-on-ion> hmmm that helped! so i had to export it because i was using the module name named after the lib =)? makes sense
<oni-on-ion> i definately learned some things =) thank you for both your patiences i very much appreciate the tolerance of my spamming/urgency. (got myself full of coffee and was half way through coding something =) bless!
<companion_cube> o/
gravicappa has quit [Ping timeout: 246 seconds]
<Netsu> companion_cube: looks like I found a workaround, what do you think about https://github.com/ocaml/dune/issues/2156#issuecomment-492366931
<companion_cube> :-s
<Netsu> companion_cube: what's wrong with it, what I miss?
<companion_cube> it seems pretty complicated for no clear benefit, is all
ShalokShalom has joined #ocaml
gravicappa has joined #ocaml
<Netsu> benefit is uniwersal dsl approach for both top modules and sub-modules in duna without fragility and with no maitance required
<oni-on-ion> dsl...ppx ?
<oni-on-ion> preprocess ?
<Netsu> dsl in plain sorce. To write Lib.Type instead of Lib.HakyHack.Type
kakadu has joined #ocaml
<companion_cube> dune isn't fragile as of now, if you use it to have each library being a list of modules
<Netsu> companion_cube: but what should I do if all I need is to split project into several submodules in separate hierarchical files? Such library structure broke natural dsl
<Netsu> fragility in maintenance sense to keep all the modules explicitly listed or to run `dune test || dune promote` each time
<companion_cube> I have absolutely no idea what you're talking about
<Armael> you could split your library into several sub-libraries?
<companion_cube> if you want Foo.Bar.A, have file bar.ml in lib foo, and a `module A = …` inside?
<Netsu> ok, I can have Bar.A where A is module type, but why can not the same for Foo module?
<Netsu> This feels like unnecessary complexity to remember which module is library, and which are not, isn't it?
unyu has quit [Ping timeout: 258 seconds]
<companion_cube> you mean for Bar, right?
<companion_cube> yeah, it only works for modules, not module types
<Netsu> and not for types. And it's limitation of dune, not module system
unyu has joined #ocaml
<companion_cube> well you can always do it by hand
<oni-on-ion> Netsu, cant you just alias modules ?
<companion_cube> with `(wrapped false)` or by writing `foo.ml`
<oni-on-ion> Today I Learned: dont have modules named the same as libraries. cognitive peace and tranquility =)
<companion_cube> except when that's what you want :D
<oni-on-ion> yeh. the land of undefined behavior
<oni-on-ion> (lots of exaggeration here)
<Netsu> companion_cube: welp, that workarond is a try to avoid fragility caused by writing it by hand... However I still can miss something
<oni-on-ion> adding rules to dune seems very much like hand-writing
<oni-on-ion> %__.ml and whatnot going on up there
<oni-on-ion> i feel that dune is happier if we learn what it expects, then we dont have to fight it
<companion_cube> indeed
<Netsu> oni-on-ion: yeah, it drawback (module_name__.ml-gen kinda private dune's api afaik)
<Netsu> I would be happier when dune will do what I expect lol
<oni-on-ion> i've seen .ml-gen files but it may appear as if you are getting into dune internals more than is necessary
<oni-on-ion> yep, today is my second "trial" with dune, trying to get it to do what i want. i learned again that its not only clearer, cleaner, but more "ocaml style" the way in which dune expects
<oni-on-ion> to do the way in which dune expects. the docs website is awfully unorganized
gravicappa has quit [Ping timeout: 244 seconds]
jao has quit [Remote host closed the connection]
jao has joined #ocaml
<Netsu> desire it to be a feature...
<oni-on-ion> i dont understand what is expected
<Netsu> reuse top module of library generated by dune
<oni-on-ion> generated ?
Guest30469 has joined #ocaml
Guest30469 has quit [Remote host closed the connection]
Guest30469 has joined #ocaml
Guest30469 has quit [Remote host closed the connection]
<Netsu> oni-on-ion: yes, see wrapped
dimitarvp has joined #ocaml
<oni-on-ion> well. what do you mean by "reuse" ?
dimitarvp has quit [Quit: Bye]
Serpent7776 has quit [Quit: leaving]
zolk3ri has quit [Remote host closed the connection]
powerbit has quit [Read error: Connection reset by peer]
nicootje has quit [Remote host closed the connection]
nicootje has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
zapashcanon has quit [Quit: Cheers !]
<oni-on-ion> ahh i hope this file is autogenerated: https://github.com/okeuday/erlang_ml/blob/master/erlang.ml#L200
<oni-on-ion> it must be, theres no way with all the duplication in that code =)
ShalokShalom has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
zapashcanon has joined #ocaml
zapashcanon has quit [Changing host]
zapashcanon has joined #ocaml
tane has quit [Quit: Leaving]
<oni-on-ion> in dune, could i do "(modules test.something)" when test.ml has "module Something ..." ?
<oni-on-ion> ie. if "test.ml" contains two modules but not both used at the same time, yet both sharing code
<oni-on-ion> ie. test.ml -> "test_cli", "test" (shared), and "test_web"
jao has quit [Remote host closed the connection]
okuu has joined #ocaml
jao has joined #ocaml
okuu has quit [Remote host closed the connection]
themsay has joined #ocaml
kakadu has quit [Remote host closed the connection]
ygrek_ has quit [Ping timeout: 258 seconds]
pierpal has quit [Ping timeout: 258 seconds]
Haudegen has quit [Ping timeout: 258 seconds]
pierpal has joined #ocaml
ziyourenxiang has joined #ocaml
AtumT has quit [Quit: AtumT]