adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.06.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.06/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
caltelt_ has quit [Ping timeout: 240 seconds]
picolino has quit [Ping timeout: 260 seconds]
picolino has joined #ocaml
caltelt has joined #ocaml
halogenandtoast has joined #ocaml
pierpa has joined #ocaml
markoong has quit [Ping timeout: 268 seconds]
mfp has quit [Ping timeout: 256 seconds]
silver has quit [Read error: Connection reset by peer]
jao has quit [Ping timeout: 248 seconds]
tormen has joined #ocaml
Jesin has quit [Quit: Leaving]
tormen_ has quit [Ping timeout: 256 seconds]
Jesin has joined #ocaml
ratschance has quit [Remote host closed the connection]
ratschance has joined #ocaml
engil has quit [Changing host]
engil has joined #ocaml
hdon has quit [Ping timeout: 276 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 256 seconds]
ygrek has quit [Ping timeout: 245 seconds]
kvda has joined #ocaml
shinnya has joined #ocaml
aggelos_ has quit [Ping timeout: 245 seconds]
pierpa has quit [Quit: Page closed]
aggelos_ has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jbrown has quit [Ping timeout: 268 seconds]
pierpal has joined #ocaml
cbot has quit [Quit: Leaving]
kvda has joined #ocaml
maarhart has joined #ocaml
maarhart has quit [Client Quit]
mbuf has joined #ocaml
hdon has joined #ocaml
hdon has quit [Ping timeout: 260 seconds]
ziyourenxiang has joined #ocaml
mbuf has quit [Quit: Leaving]
mbuf has joined #ocaml
caltelt has quit [Ping timeout: 264 seconds]
JimmyRcom_ has joined #ocaml
JimmyRcom_ has quit [Ping timeout: 256 seconds]
tarptaeya has joined #ocaml
Haudegen has joined #ocaml
dhil has joined #ocaml
sagotch has joined #ocaml
dhil has quit [Ping timeout: 255 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 256 seconds]
Haudegen has quit [Remote host closed the connection]
Guest6912 has joined #ocaml
<xvilka> hi! I have a code like that to build a tree with multiple children https://pastebin.com/1ixkriwq
<xvilka> But in fact instead of building tree it build a new pair parent->children every time, do not propagating changed hierarchical links across all the tree
<xvilka> what I did wrong here?
nullifidian has quit [Remote host closed the connection]
rwmjones has quit [Quit: ZNC - 1.6.0 - http://znc.in]
rwmjones has joined #ocaml
<xvilka> how in my case update the whole chain properly (and most effectively)?
ia0 has quit [Quit: reboot]
ia0 has joined #ocaml
steenuil_ has joined #ocaml
malina has joined #ocaml
steenuil has quit [Ping timeout: 255 seconds]
<xvilka> nevermind, I will just rewrite everything to use mutable records, it is easier
<Fardale> xvilka: Node of 'a * 'a multitree * 'a multitree list <= what is the first 'a multitree ?
<zozozo> Fardale: I think it's tha back-reference to the parent
<Fardale> ok, I don't know if it's possible to use such type
<xvilka> Fardale: zozozo: yes, it is a parent
sagotch has quit [Ping timeout: 265 seconds]
steenuil__ has joined #ocaml
<Fardale> xvilka: why do you need the parent of the node ?
sagotch has joined #ocaml
<Fardale> the usual type for tree is something like Node of 'a * 'a multitree list
<Fardale> and you alway start from the root to go down to the leaves
<xvilka> Fardale: I am coding algorithm exactly as described from the specification
steenuil_ has quit [Ping timeout: 245 seconds]
<xvilka> Fardale: yes, I know about usual trees, used them before, parent "link" makes everything complex...
<xvilka> Fardale: maybe it is possible to rewrite it without using parents' access, but I have no time for algorithm redesign tbh
mfp has joined #ocaml
halogenandtoast has quit [Ping timeout: 240 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 265 seconds]
shinnya has quit [Ping timeout: 268 seconds]
zolk3ri has joined #ocaml
freyr69 has joined #ocaml
_whitelogger has joined #ocaml
dejanr has quit [Ping timeout: 276 seconds]
nullifidian has joined #ocaml
silver has joined #ocaml
argent_smith has joined #ocaml
sagotch has quit [Ping timeout: 264 seconds]
hannes has quit [Remote host closed the connection]
Guest6912 has quit [Remote host closed the connection]
markoong has joined #ocaml
dejanr has joined #ocaml
jao has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pierpal has quit [Read error: Connection reset by peer]
shinnya has joined #ocaml
neatonk has quit [Ping timeout: 265 seconds]
neatonk has joined #ocaml
pierpal has joined #ocaml
dhil has joined #ocaml
<Drup> It's not a difficult redesign if you only ever need to access the current parent (and not the grandparents, and so on)
<Drup> It just means your recursive functions takes an extra parameter, which is the parent of the current node, and that's it
<discord> <Christophe> Also you need to create the list of children and the parent simultaneously, with let parent = ... and children = ...
Haudegen has joined #ocaml
<discord> <Christophe> (instead of two let... in)
sagotch has joined #ocaml
dhil has quit [Ping timeout: 264 seconds]
mioawef has joined #ocaml
<mioawef> Do OCaml users have a project-manifest-based package manager, such as default.nix, package.json, Cargo.toml, or project.clj/build.boot? Such that one can add dependencies to the project, check a text file or two in, and then you always have your deps at hand?
<mioawef> Or should you just write some instructions with shell commands in a README file and the user does that?
<ZirconiumX> mioawef: opam
<ZirconiumX> You make a .opam file
<ZirconiumX> Or just export a switch
<ZirconiumX> And then check the .opam into the repo
slehuito has joined #ocaml
<ZirconiumX> Opam is the official package manager for it, to boot
slehuito has quit [Remote host closed the connection]
<mioawef> ZirconiumX: Thank you. I realize this is a newb question, but I'm not finding this information searching the web. Where can one read more about how to structure or initialize the contents of the `project_dir/.opam` file?
<ZirconiumX> I don't know articles about it
<ZirconiumX> But I can point to examples of those files
sagotch has quit [Ping timeout: 245 seconds]
<Drup> mioawef: the opam documentation ? :)
mbuf has quit [Quit: Leaving]
<mioawef> Drup: been trying to parse https://opam.ocaml.org/doc/Manual.html but didn't get it without an example. May very well be that I'm more closely related to chimps than most other homo sapiens ;)
<mioawef> ZirconiumX: thanks, that was simpler than I made it out to be. Much appreciated!
<Drup> mioawef: https://opam.ocaml.org/doc/Packaging.html this is more appropriate for you
dhil has joined #ocaml
<ZirconiumX> mioawef: happy to help. I'm a newbie too, so I understand where you're coming from
<mioawef> Drup: awesome! Thanks a lot!
<mioawef> ZirconiumX: Sweet :-) OCaml is pretty cool innit
<ZirconiumX> Ah, a fellow Brit
<ZirconiumX> I think OCaml hits a nice sweet spot
<mioawef> ZirconiumX: Swede! (not yet mashed). Agreed wrt sweet spot
<ZirconiumX> Ah, fair enough
<ZirconiumX> I think the OCaml syntax is quite nice, honestly
<ZirconiumX> But then again I find python nice to look at, and I got jokes from some of my friends about that
<ZirconiumX> Anyway, welcome to the OCaml community, mioawef
<mioawef> Thanks and as a member of the OCaml community, I welcome you too. How pleasant
<ZirconiumX> Well, "don't be a dick" is one of my guiding principles
<ZirconiumX> So I do try to be friendly
<mioawef> (yep, didn't mean to be ironic). Whatcha working on in OCaml? For an employer or as a hobby or startup?
<mioawef> (eh sarcastic)
<ZirconiumX> It's mostly a hobby
<ZirconiumX> I'm a student, and unfortunately without a degree I'm not very interesting to employers
<ZirconiumX> I've been working on a JPEG decoder in OCaml
jao has quit [Ping timeout: 240 seconds]
mioawef` has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
mioawef has quit [Ping timeout: 276 seconds]
<octachron> does anyone remember seeing a "locally bound module name escape its scope" error message since OCaml 4.00?
<companion_cube> is it a `let module … = … in` ?
<companion_cube> (with a first-class module perhaps)
<Drup> octachron: what's the code that raises that ?
<Drup> At this point, maybe it would be worth it to apply bisect to the typechecker, run the testquite and see what's the result :D
<octachron> there is a recent comment by Jacque saying that it can only happen when type_expect is called with a generic type variable as an expected type
<companion_cube> or `rg "locally bound module"`
<octachron> but as far as I can see, those case are necessarily caught by the call to type_expect
<octachron> Drup, this is mostly what I have been doing in a more ad-hoc and limited way for errors
<octachron> i.e. , "let module = struct type t = A end in M.A" triggers the error in 3.12 but starting with 4.00 it raises a generic "The type constructor M.t" would escape its scope
<Drup> According to the comment, this is about checking for cycles
mioawef`` has joined #ocaml
mioawef` has quit [Ping timeout: 245 seconds]
<Drup> octachron: I think this is a case where we need Jacques.
<companion_cube> (now picturing a lambda version of Super Dupont)
halogenandtoast has joined #ocaml
<companion_cube> yeah but I meant Super Dupont, not superman :p
<companion_cube> a bit more… franchouillard
sagotch has joined #ocaml
<Drup> companion_cube: I feel Jacques is more Hiro Nakamura than Dupont. ;)
<companion_cube> never met him ^_^'
halogenandtoast has quit [Ping timeout: 245 seconds]
<octachron> Drup, I am not sure why cycles should behave differenty here.
<rks`> octachron: I was replying (in french) in the next room
<rks`> (because I'm lazy)
<rks`> but I can move the discussion here if you'd like that better
<rks`> let's do that actually
<octachron> rks`, as you wish, thanks
<rks`> as I was saying: if the ty_expected that flows in is not generic the error will indeed be caught when calling type_expect on sbody
<rks`> as the note says in the comment
<rks`> I'm not sure I understand your remark though, i.e.
<rks`> 15:02 < octachron> but as far as I can see, those case are necessarily caught by the call to type_expect
<rks`> I think that if you want to see this error happen
<rks`> hmmm, I was about to say something stupid.
<Drup> My intuition is that we need an occur/escape check for variables
<rks`> but I'd still like some more explanation about your remark
<Drup> and that unify will always perform that
dhil has quit [Ping timeout: 264 seconds]
<rks`> Drup: unify will update level, which will indeed trigger a "scope escape" issue
<Drup> But I couldn't build an example that triggers that
hdon has joined #ocaml
<octachron> if the expected type is generic, it means that it would have been generated as a generic type variable, thus with an lower level that the one generated specifically for this check? Or am I missing something?
sagotch has quit [Ping timeout: 245 seconds]
hdon has quit [Ping timeout: 245 seconds]
sagotch has joined #ocaml
<rks`> octachron: I'm not sure you'll ever get a generic variable (but you might, I don't know)
<rks`> but you might get a non variable type on which generalize_structure was called
_andre has joined #ocaml
<rks`> (that could happen when type_expect is called from type_cases for example)
<rks`> (and probably other places too, but at least I know of that one)
dhil has joined #ocaml
<rks`> one is not allowed to use « with module » on package types :(
malina has quit [Ping timeout: 240 seconds]
<octachron> and the error is a parser error, isn'it?
<rks`> don't think so
<rks`> « Error: invalid package type: only 'with type t =' constraints are supported »
<rks`> ah yes indeed
<rks`> that's emitted by syntaxerr.ml
jbrown has joined #ocaml
<rks`> hum octachron
<octachron> ?
<rks`> I assume you played the git blame game
<rks`> did you look into why the "correct_levels" was introduced around ty_expected when typing the body? (and why it was removed)
<octachron> briefly?
<rks`> anyway
<rks`> it seems like the check is indeed useless nowadays
<rks`> but Drup was (sadly) right
<rks`> currently, only Jacques can confirm
<rks`> (that is: I don't want to spend hours checking that, and neither do you)
<octachron> rks`, you are right; I think I will submit my PR with the examples for all other errors in typecore.ml and ask Jacques about this case (and another similar one)
<rks`> you can also try to ping Leo
<rks`> but yes, that sounds like a good approach
<octachron> Drup, rks` : thanks for the discussion
<rks`> also, if this check does need to stay, then we can probably replace the call to unify_var by a call to check_scope_escape
<rks`> (because clearly, we don't need to pay the occur check here, there's _no way_ that ty is present inside body.exp_type)
<rks`> (and we also don't need a bunch of the other checks)
<rks`> anyway, coffee break
<rks`> actually, that might be wrong
<rks`> i dont think check_scope_escape checks the path binding time
<rks`> so we still need the call to update_level
<rks`> but pffff, that also needs to change
mioawef`` has quit [Ping timeout: 245 seconds]
malina has joined #ocaml
mioawef`` has joined #ocaml
mioawef`` has quit [Ping timeout: 265 seconds]
hdon has joined #ocaml
hdon has quit [Ping timeout: 240 seconds]
sz0 has joined #ocaml
FreeBirdLjj has joined #ocaml
JimmyRcom_ has joined #ocaml
jao has joined #ocaml
mioawef`` has joined #ocaml
mk9 has joined #ocaml
<rks`> octachron: leo confirms that the check has been dead for ages
<rks`> (since we started using type_expect everywhere)
freyr69 has quit [Remote host closed the connection]
<octachron> rks`, ok thanks
mioawef`` has quit [Ping timeout: 256 seconds]
malina has quit [Ping timeout: 260 seconds]
mioawef`` has joined #ocaml
_andre has quit [Ping timeout: 240 seconds]
_andre has joined #ocaml
halogenandtoast has joined #ocaml
al-damiri has joined #ocaml
sagotch has quit [Ping timeout: 245 seconds]
mioawef`` has quit [Read error: Connection reset by peer]
mk9 has quit [Quit: mk9]
halogenandtoast has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 256 seconds]
Lucretia has left #ocaml ["Leaving"]
JimmyRcom_ has quit [Ping timeout: 240 seconds]
Haudegen has quit [Remote host closed the connection]
mk9 has joined #ocaml
mk9 has quit [Quit: mk9]
jao has quit [Ping timeout: 264 seconds]
pierpal has joined #ocaml
malina has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
dariusf has joined #ocaml
dariusf has quit [Client Quit]
ziyourenxiang has quit [Ping timeout: 256 seconds]
r3s1stanc3 has quit [Quit: ZNC 1.7.0 - https://znc.in]
r3s1stanc3 has joined #ocaml
yomimono has quit [Ping timeout: 240 seconds]
yomimono has joined #ocaml
malina has quit [Ping timeout: 256 seconds]
mioawef`` has joined #ocaml
Haudegen has joined #ocaml
malina has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
mioawef`` has quit [Ping timeout: 265 seconds]
ygrek has joined #ocaml
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
dtornabene has quit [Remote host closed the connection]
malina has quit [Ping timeout: 260 seconds]
hdon has joined #ocaml
larhat has joined #ocaml
tarptaeya has quit [Quit: Konversation terminated!]
JimmyRcom_ has joined #ocaml
yomimono has quit [Ping timeout: 260 seconds]
dhil has quit [Ping timeout: 240 seconds]
hdon has quit [Changing host]
hdon has joined #ocaml
JimmyRcom_ has quit [Ping timeout: 256 seconds]
yomimono has joined #ocaml
hannes has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
jnavila has joined #ocaml
pierpal has joined #ocaml
jack5638 has quit [Ping timeout: 240 seconds]
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
JimmyRcom_ has joined #ocaml
jack5638 has joined #ocaml
roygbiv has joined #ocaml
freyr69 has joined #ocaml
halogenandtoast has joined #ocaml
JimmyRcom_ has quit [Ping timeout: 276 seconds]
JimmyRcom_ has joined #ocaml
cryptocat1094 has joined #ocaml
halogenandtoast has quit [Ping timeout: 255 seconds]
haesbaert has quit [Read error: Connection reset by peer]
NingaLeaf has joined #ocaml
reynir has quit [Quit: WeeChat 2.0.1]
shinnya has joined #ocaml
NingaLeaf has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roygbiv has quit [Quit: ™]
haesbaert has joined #ocaml
pierpa has joined #ocaml
Haudegen has quit [Remote host closed the connection]
reynir has joined #ocaml
nahra has joined #ocaml
NingaLeaf has joined #ocaml
jao has joined #ocaml
Haudegen has joined #ocaml
cryptocat1094 has quit [Quit: WeeChat 1.6]
roygbiv has joined #ocaml
moei has quit [Quit: Leaving...]
freyr69 has quit [Remote host closed the connection]
malina has joined #ocaml
_andre has quit [Quit: leaving]
mk9 has joined #ocaml
NingaLeaf has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jnavila has quit [Remote host closed the connection]
NingaLeaf has joined #ocaml
NingaLeaf has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
unyu has quit [Quit: The end of the world is nigh. Bring as much popcorn as you can!]
malina has quit [Ping timeout: 240 seconds]
loli has joined #ocaml
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
coventry2 has joined #ocaml
cbot has joined #ocaml
moei has joined #ocaml
mk9 has quit [Quit: mk9]
argent_smith has quit [Quit: Leaving.]
<coventry2> I've run into a problem with a project initialized with eliom-distillery. If I put `ppx_deriving_lens` in `Makefile.options`'s `SERVER_PACKAGES` variable, which already contains `ppx_deriving_yojson` and `deriving-yojson`, resulting in an `eliomc ... -package ppx_deriving_yojson -package deriving-yojson -package ppx_deriving_lens` command, I wind up with an error, `Cannot locate deriver yojson`. Anyone run into a problem like this?
larhat has quit [Quit: Leaving.]
kvda has joined #ocaml
Haudegen has quit [Remote host closed the connection]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ziyourenxiang has joined #ocaml
coventry2 has quit [Ping timeout: 265 seconds]
kvda has joined #ocaml
kvda has quit [Client Quit]
roygbiv has quit [Quit: ™]
ziyourenxiang has quit [Ping timeout: 240 seconds]
unyu has joined #ocaml
shw has left #ocaml [#ocaml]
JimmyRcom_ has quit [Ping timeout: 255 seconds]