adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.07.0 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
ShalokShalom has quit [Ping timeout: 252 seconds]
ShalokShalom has joined #ocaml
nicoo has quit [Ping timeout: 256 seconds]
ziyourenxiang has joined #ocaml
nicoo has joined #ocaml
ShalokShalom has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
apostolis has quit [Quit: WeeChat 1.6]
silver has quit [Read error: Connection reset by peer]
mfp has quit [Ping timeout: 252 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
xuanrui has joined #ocaml
xuanrui has quit [Read error: Connection reset by peer]
w-j-w has joined #ocaml
<w-j-w> Quick question: is there a concise way to destructure a record so that the names of the fields are simply there inside a function?
<w-j-w> like, if I had a "type person = {name:string; age:int}", could I quickly destructure inside a function so that name and age would be usable bindings wihtout having to spell out the names again?
Misha_B has quit [Remote host closed the connection]
tormen_ has joined #ocaml
tormen has quit [Ping timeout: 244 seconds]
<thizanne> you can do let f { name = foo; age = bar } = foo, bar
<thizanne> which is the standard way of pattern-matching on records
<thizanne> but you can also use the shortcut let f { name; age } = name, age
<thizanne> w-j-w:
hnfmr has joined #ocaml
<hnfmr> hey guys, where can I learn more about this syntax: type _a = ..
<hnfmr> sorry: type _ a = ..
<hnfmr> it's probably called extensible variant type
<w-j-w> thanks thizanne for the help earlier, but now I have another problem. Toplevel is telling me that I have a 'syntax error' when I do the following:
<w-j-w>
<w-j-w> let add doccol name doc =
<w-j-w> if List.mem_assoc name doccol.docs then
<w-j-w> begin
<w-j-w> doccol.count <- doccol.count + 1;
<w-j-w> doccol.docs <- (name,doc)::doccol.docs;
<w-j-w> end;
<w-j-w> true
<w-j-w> else
<w-j-w> false
<w-j-w> ;;
<w-j-w> it occurs at the else
<w-j-w> also, is there a way to make the error messages less vague?
<w-j-w> the rust compiler spoiled me in that regard
<w-j-w> I fixed it. Turns out the answer was always parenthesis.
<w-j-w>
<w-j-w> (
<w-j-w> if List.mem_assoc name doccol.docs then
<w-j-w> let add doccol name doc =
<w-j-w> doccol.count <- doccol.count + 1;
<w-j-w> doccol.docs <- (name,doc)::doccol.docs;
<w-j-w> true
<w-j-w> )
<w-j-w> else
<w-j-w> false
<w-j-w> ;;
<thizanne> w-j-w: actually you can use begin/end (they're equivalent to parentheses almost everywhere), but you need to put `true` inside
<thizanne> (that's exactly what you did on the second example)
<thizanne> `if a then b; c else d` is indeed parsed as `(if a then b); c else d` which is a syntax error
dedgrant_ has joined #ocaml
orbitz_ has joined #ocaml
iZsh has quit [Ping timeout: 244 seconds]
xa0 has quit [Ping timeout: 244 seconds]
iZsh has joined #ocaml
ehirdoy has quit [Ping timeout: 244 seconds]
ehirdoy has joined #ocaml
xa0 has joined #ocaml
jrslepak has quit [Ping timeout: 244 seconds]
alphor has quit [Ping timeout: 244 seconds]
orbitz has quit [Ping timeout: 244 seconds]
jrslepak has joined #ocaml
dedgrant has quit [Ping timeout: 244 seconds]
alphor has joined #ocaml
hnfmr has quit [Quit: Page closed]
runciter_ has joined #ocaml
iZsh has quit [Ping timeout: 244 seconds]
runciter has quit [Ping timeout: 244 seconds]
iZsh has joined #ocaml
xa0 has quit [Ping timeout: 244 seconds]
dmbaturin has quit [Ping timeout: 244 seconds]
dmbaturin has joined #ocaml
xa0 has joined #ocaml
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
webshinra has quit [Remote host closed the connection]
webshinra has joined #ocaml
JimmyRcom has joined #ocaml
muelleme_ has joined #ocaml
ggole has joined #ocaml
muelleme_ has quit [Ping timeout: 244 seconds]
Ou42 has joined #ocaml
<Ou42> bonjour! hello! any fun mooc students/teachers/geniuses here?! :D
isbromberg has joined #ocaml
isbromberg has left #ocaml [#ocaml]
philtor has quit [Remote host closed the connection]
runciter_ is now known as runciter
al-damiri has quit [Quit: Connection closed for inactivity]
dmiles has quit [Ping timeout: 268 seconds]
JimmyRcom has quit [Ping timeout: 246 seconds]
noitakomentaja has quit [Ping timeout: 250 seconds]
rdivyanshu has joined #ocaml
muelleme_ has joined #ocaml
muelleme_ has quit [Ping timeout: 250 seconds]
kvda has joined #ocaml
err0ne has joined #ocaml
rdivyanshu has quit [Remote host closed the connection]
rdivyanshu has joined #ocaml
dmiles has joined #ocaml
<xvilka> is it possible to resolve Lwt promise without Lwt_main.run somehow? I used "lwt_returning_func bla >>= fun foo -> (); let some = func1 foo ..."
<xvilka> but compiler complains
noitakomentaja has joined #ocaml
<flux[m]> xvilka: I don't think that's possible in general.. but you can run Lwt_main.run inside Lwt_main.run, so I think you could just do that?
<flux[m]> this may also be something you shouldn't be doing, but if you must.. ?
sagotch has joined #ocaml
nullifidian has quit [Ping timeout: 260 seconds]
nicoo has quit [Ping timeout: 256 seconds]
nicoo has joined #ocaml
noitakomentaja has quit [Ping timeout: 252 seconds]
orbifx has joined #ocaml
<xvilka> flux[m]: yeah, I heard nesting Lwt_main.run can bring some problems, even met such case once
noitakomentaja has joined #ocaml
<Ou42> bonjour! hello! any fun mooc students/teachers/geniuses here?! :D
orbifx has quit [Ping timeout: 272 seconds]
rand__ has joined #ocaml
rand__ has quit [Ping timeout: 252 seconds]
noitakomentaja has quit [Ping timeout: 250 seconds]
nullifidian has joined #ocaml
keep_learning_M has joined #ocaml
rand__ has joined #ocaml
TheLemonMan has joined #ocaml
rdivyanshu has quit []
keep_learning_M has quit [Quit: Leaving]
<zozozo> Ou42: i don't know if people here are following the mooc, why are you asking ?
<Ou42> just curious. I'm too chicken to post to the forums. never liked recursion. avoided it for years. guess that vacation's over. ;o)
ShalokShalom has joined #ocaml
Haudegen has joined #ocaml
mfp has joined #ocaml
<Ou42> g'nite TTFN
Ou42 has quit [Quit: Leaving]
silver has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
ehmry_ is now known as ehmry
ehmry has left #ocaml ["WeeChat 2.1"]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
emias has quit [Quit: Reboot.]
muelleme_ has joined #ocaml
muelleme_ has quit [Ping timeout: 250 seconds]
emias has joined #ocaml
TheLemonMan has joined #ocaml
govno_ has joined #ocaml
Haudegen has quit [Remote host closed the connection]
govno_ has left #ocaml [#ocaml]
spew has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
rdivyanshu has joined #ocaml
JimmyRcom has joined #ocaml
FreeBirdLjj has joined #ocaml
sagotch has quit [Ping timeout: 245 seconds]
sagotch has joined #ocaml
groovy2shoes has quit [Ping timeout: 264 seconds]
groovy2shoes has joined #ocaml
al-damiri has joined #ocaml
<dreamer> hmm, trying to install the latest ocaml switch with opam on stretch, but running into: Can't bind mount /newroot/proc/sysrq-trigger on /newroot/proc/sysrq-trigger: No such file or directory
groovy2shoes has quit [Client Quit]
<dreamer> any ideas? what I can see is that it might be related to 'bubblewrap', but on a similar machine (stretch and same versions) I was able to create this switch
<dreamer> hmm, trying a fresh .opam but I get exactly the same
<dreamer> using opam from the install.sh
mikedillion has joined #ocaml
mikedillion has quit [Remote host closed the connection]
potsNI has joined #ocaml
themsay has joined #ocaml
potsNI has quit [Remote host closed the connection]
themsay has quit [Ping timeout: 246 seconds]
ImtekbC has joined #ocaml
neatonk has quit [Remote host closed the connection]
neatonk has joined #ocaml
ImtekbC has quit [Ping timeout: 250 seconds]
rdivyanshu has quit [Read error: Connection reset by peer]
ThatOneRoadieqr has joined #ocaml
ThatOneRoadieqr has quit [Remote host closed the connection]
allu2Yo has joined #ocaml
sagotch has quit [Quit: Leaving.]
nicoo has quit [Ping timeout: 256 seconds]
nicoo has joined #ocaml
allu2Yo has quit [Remote host closed the connection]
rdivyanshu has joined #ocaml
rand__ has quit [Ping timeout: 245 seconds]
tdriq has joined #ocaml
DerekTheRedrn has joined #ocaml
DerekTheRedrn has quit [Remote host closed the connection]
tdriq has quit [Remote host closed the connection]
nullifidian has quit [Read error: Connection reset by peer]
nullifidian has joined #ocaml
fletomJq has joined #ocaml
fletomJq has quit [Remote host closed the connection]
<dreamer> hm, so nobody a clue as to why opam init fails?
orbifx has joined #ocaml
<companion_cube> seems weird… it's stupid but maybe, if you just installed bubblewrap, try to reboot?
<companion_cube> (no idea if it helps, but with such weird errors it's hard to know)
feodoranum has joined #ocaml
feodoranum has quit [Remote host closed the connection]
JimmyRcom has quit [Ping timeout: 245 seconds]
jnavila has joined #ocaml
<dreamer> companion_cube: bubblewrap is installed though
<dreamer> quite old version as debian stretch, but on other machine it was the same
<dreamer> different kernel I see
<dreamer> but otherwise, buth debian stretch
<companion_cube> I meant, if you hadn't rebooted since installing bubblewrap
noitakomentaja has joined #ocaml
ZygoXV has joined #ocaml
<companion_cube> but anyway I don't know a good way of fixing such issues
jokkeaS has joined #ocaml
jokkeaS has quit [Remote host closed the connection]
ZygoXV has quit [Remote host closed the connection]
ziyourenxiang has quit [Ping timeout: 250 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
maarhart has joined #ocaml
rand__ has joined #ocaml
maarhart has quit [Client Quit]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 250 seconds]
w-j-w has quit [Remote host closed the connection]
w-j-w has joined #ocaml
<dreamer> companion_cube: ok, shouldn't be an issue, but will relay the admin of the box
<companion_cube> I mean, try other things in the mean time right?
<companion_cube> (it does sound like `newroot` is a chroot that bubblewrap would install… I suppose)
FreeBirdLjj has joined #ocaml
w-j-w has left #ocaml [#ocaml]
w-j-w has joined #ocaml
<w-j-w> Can someone explain to me how to destructure a tuple argument? I'm having some trouble with the `as' keyword. Using (p as (n, d)) as an argument gives me a syntax error: expected operator at the comma.
<w-j-w>
<octachron> simply (n, d) works
<companion_cube> ((n,d) as p)
<companion_cube> (if you also want to name the tuple)
<w-j-w> when I try that in the following function i simply get 'syntax error'
<w-j-w>
<w-j-w> let showall doc_col =
<w-j-w> let items = doc.curdoc.current in
<w-j-w> let show_doc name doc =
<w-j-w> Printf.printf "--List %s--\n";
<w-j-w> List.iter print_endline items;
<w-j-w> print_endline "" in
<companion_cube> please use a pastebin or something :/
<w-j-w> List.iter (fun (n, d) -> show_doc n d) doc_col.docs
<w-j-w> ;;
<w-j-w> ok 1 sec
<companion_cube> too late…
<companion_cube> weird, that seems correct
<w-j-w> the error happens at the `L' in List.iter
<companion_cube> (btw the first printf misses an argument)
<w-j-w> I see that now. For some reason pretty much exactly that wouldn't compile earlier
<ggole> print_endline "" should probably be print_newline ()
muelleme_ has joined #ocaml
<ggole> It's not wrong, just stylistically strange
<w-j-w> I am very new to ocaml. Taking it for a class. bodging together things that """work""" is about par for the course
muelleme_ has quit [Ping timeout: 252 seconds]
nullifidian_ has joined #ocaml
nullifidian has quit [Read error: Connection reset by peer]
regulus_ has joined #ocaml
rdivyanshu has quit [Remote host closed the connection]
nicoo has quit [Ping timeout: 256 seconds]
nicoo has joined #ocaml
regulus_ has quit [Ping timeout: 252 seconds]
rdivyanshu has joined #ocaml
rdivyanshu has quit [Ping timeout: 250 seconds]
orbifx has quit [Ping timeout: 246 seconds]
ludocodeJU has joined #ocaml
ludocodeJU has quit [Remote host closed the connection]
muelleme_ has joined #ocaml
bobdobbssX has joined #ocaml
maarhart has joined #ocaml
bobdobbssX has quit [Remote host closed the connection]
maarhart has quit [Ping timeout: 252 seconds]
w-j-w has quit [Ping timeout: 260 seconds]
Jesin has joined #ocaml
muelleme_ has quit [Quit: WeeChat 1.5]
FreeBirdLjj has quit [Remote host closed the connection]
rdivyanshu has joined #ocaml
rdivyanshu has quit [Ping timeout: 250 seconds]
rdivyanshu has joined #ocaml
jsmithqc has joined #ocaml
jsmithqc has quit [K-Lined]
rdivyanshu has quit [Ping timeout: 246 seconds]
rdivyanshu has joined #ocaml
sethetter has joined #ocaml
rdivyanshu has quit [Ping timeout: 268 seconds]
rdivyanshu has joined #ocaml
sethetter has quit [Remote host closed the connection]
rdivyanshu has quit [Ping timeout: 245 seconds]
<dreamer> companion_cube: seems the kernel on that machine didn't support this kind of behaviour by bwrap. got a default kernel now and trying to make the switch again
benizac has joined #ocaml
<companion_cube> :/
<companion_cube> good luck
barcabuona has joined #ocaml
roygbiv has joined #ocaml
nicoo has quit [Ping timeout: 256 seconds]
roygbiv has quit [Quit: ™]
nicoo has joined #ocaml
JimmyRcom has joined #ocaml
coffeecupp has joined #ocaml
tsani has quit [Read error: Connection reset by peer]
kakadu_ has joined #ocaml
erwanou has joined #ocaml
coffeecupp has quit [Remote host closed the connection]
orbifx has joined #ocaml
pgiarrusso has joined #ocaml
<pgiarrusso> hey all! On opam 1.2 -> 2.0 upgrade: am I supposed to clear my old opam install or does it keep working? The website says this works, my experience says "not at all" and I've been busy reporting bugs. Is there a point in reporting them, or should I just try to get the docs changed?
<dreamer> companion_cube: hmm: Sys_error("/home/user/.opam/repo/default/packages/ocaml/ocaml.4.07.0/files/gen_ocaml_config.ml.in: No such file or directory")
tsani has joined #ocaml
<companion_cube> maybe it was not generated because last time the build was interrupted by the kenrel error?
<companion_cube> pgiarrusso: it's a pain, in my experience, too :/
<dreamer> yeah I'm trying with a completely fresh .opam now
<dreamer> fingers crossed
* dreamer needs newer ocaml for latest liquidsoap
<pgiarrusso> meanwhile, if is ocaml 4.07.1 is released (as https://opam.ocaml.org/packages/ocaml/ and opam say), is it normal that https://ocaml.org/ says nothing?
<dreamer> hmmm is it? I'm just creating a 4.07.0 switch :#
<pgiarrusso> LOL it's listed here: https://ocaml.org/releases/
<pgiarrusso> I also created a 4.07.0 switch like two days ago
<dreamer> I don't need latest and greatest. just something newer than I have now :)
<dreamer> I think 4.03 is the minimum or something
<companion_cube> oh wow, is your version 4.01 or something?
<dreamer> ocaml.4.02.3 << according to opam init
<companion_cube> yeah that's quite old
<companion_cube> you can try to use 4.06 if 4.07 is too complicated to install?
<dreamer> I already installed 4.07 on another stretch machine. it should work damnit :P
<companion_cube> :D
<dreamer> ok, done
<dreamer> \o/
nullifidian__ has joined #ocaml
nullifidian_ has quit [Read error: Connection reset by peer]
<companion_cube> \o/
orbifx has quit [Ping timeout: 268 seconds]
pmetzger has joined #ocaml
ggole has quit [Quit: ggole]
orbifx has joined #ocaml
Jesin has quit [Quit: Leaving]
nullifidian__ is now known as nullifidian
pmetzger has quit []
spew has quit [Quit: to the bar]
nullifidian_ has joined #ocaml
nullifidian has quit [Read error: Connection reset by peer]
<ec> hmmmm
rand__ has quit [Ping timeout: 244 seconds]
<ec> so I'm trying to replicate a bit of an npm-ish workflow in opam 2.0
<ec> I have a file named `excmd-parser-pkg.opam.locked` (name chosen basically at random to not conflict with anything); I want people cloning the repository to be able to get up to speed quickly, the way `npm install` provides for JS projects.
<ec> based on my reading of the opam wiki and manpages, it sounds like the command in question would be:
<ec> `opam pin add --locked --inplace-build ./pkg/excmd-parser-pkg.opam.locked`
<ec> but I'm having no luck with that. opam complains that “[ERROR] Could not retrieve excmd-parser-pkg.opam.locked (could not extract archive)”
<ec> (well, no shit, it's not a real package that's published anywhere :P)
<ec> any tips? is the workflow for this sort of thing settled yet?
silver_ has joined #ocaml
nullifidian_ is now known as nullifidian
silver has quit [Ping timeout: 246 seconds]
orbifx has quit [Ping timeout: 244 seconds]
<pgiarrusso> ec: I think make build-dep in https://gitlab.mpi-sws.org/FP/iris-coq/ achieves that (and wasn’t hard to use), based on the dependencies in the opam file, and people in that team use that systematically
bartholin has quit [Remote host closed the connection]
<dreamer> uhg: [ERROR] The compilation of duppy failed at "/home/user/.opam/opam-init/hooks/sandbox.sh build make".
themsay has joined #ocaml
themsay has quit [Read error: Connection reset by peer]
themsay has joined #ocaml
themsay has quit [Read error: Connection reset by peer]
themsay has joined #ocaml
<dreamer> ocamlfind: Package `camlp4.quotations.o' not found
<dreamer> camlp4 is installed though
themsay has quit [Ping timeout: 272 seconds]
jnavila has quit [Remote host closed the connection]
al-damiri has quit [Quit: Connection closed for inactivity]
kakadu_ has quit [Remote host closed the connection]
rdivyanshu has joined #ocaml
rdivyanshu has quit [Ping timeout: 252 seconds]