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
env__ has joined #ocaml
xuanrui has joined #ocaml
env__ has quit [Ping timeout: 246 seconds]
webshinra has quit [Remote host closed the connection]
JimmyRcom has joined #ocaml
aydio has quit [Quit: WeeChat 2.2]
JimmyRcom has quit [Ping timeout: 264 seconds]
JimmyRcom has joined #ocaml
env__ has joined #ocaml
silver_ has quit [Read error: Connection reset by peer]
struktured has joined #ocaml
_whitelogger has joined #ocaml
struktured has quit [Ping timeout: 268 seconds]
JimmyRcom has quit [Ping timeout: 245 seconds]
mfp has quit [Ping timeout: 252 seconds]
tormen has joined #ocaml
tormen_ has quit [Ping timeout: 245 seconds]
struktured has joined #ocaml
JimmyRcom has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
env__ has quit [Ping timeout: 246 seconds]
env__ has joined #ocaml
jao has quit [Ping timeout: 246 seconds]
env__ has quit [Ping timeout: 240 seconds]
env__ has joined #ocaml
pepesza has quit [Ping timeout: 245 seconds]
pepesza has joined #ocaml
env__ has quit [Ping timeout: 272 seconds]
env__ has joined #ocaml
rdivyanshu has joined #ocaml
pierpal has quit [Ping timeout: 252 seconds]
_andre has quit [Quit: Lost terminal]
JimmyRcom has quit [Ping timeout: 245 seconds]
JimmyRcom has joined #ocaml
pierpal has joined #ocaml
pierpal has quit [Read error: Connection reset by peer]
Haudegen has joined #ocaml
pierpal has joined #ocaml
Haudegen has quit [Remote host closed the connection]
env__ has quit [Ping timeout: 240 seconds]
env__ has joined #ocaml
env__ has quit [Ping timeout: 268 seconds]
env__ has joined #ocaml
env__ has quit [Ping timeout: 252 seconds]
sagotch has joined #ocaml
rdivyanshu has quit [Remote host closed the connection]
rdivyanshu has joined #ocaml
emily has quit [Ping timeout: 252 seconds]
orbifx1 has joined #ocaml
rdivyanshu has quit [Ping timeout: 252 seconds]
rdivyanshu has joined #ocaml
sagax_ has joined #ocaml
orbifx1 has quit [Ping timeout: 252 seconds]
rdivyanshu has quit [Ping timeout: 252 seconds]
rdivyanshu has joined #ocaml
env__ has joined #ocaml
env__ has quit [Ping timeout: 246 seconds]
struktured has quit [Ping timeout: 252 seconds]
env__ has joined #ocaml
env__ has quit [Ping timeout: 246 seconds]
MadcapJake has quit [Ping timeout: 272 seconds]
MadcapJake has joined #ocaml
env__ has joined #ocaml
env__ has quit [Ping timeout: 252 seconds]
rdivyanshu has quit []
env__ has joined #ocaml
env__ has quit [Ping timeout: 245 seconds]
JimmyRcom has quit [Ping timeout: 252 seconds]
env__ has joined #ocaml
env__ has quit [Ping timeout: 252 seconds]
nullifidian has quit [Ping timeout: 244 seconds]
env__ has joined #ocaml
env__ has quit [Ping timeout: 246 seconds]
webshinra has joined #ocaml
env__ has joined #ocaml
env__ has quit [Ping timeout: 252 seconds]
env__ has joined #ocaml
env__ has quit [Ping timeout: 250 seconds]
env__ has joined #ocaml
env__ has quit [Ping timeout: 245 seconds]
nullifidian has joined #ocaml
env__ has joined #ocaml
env__ has quit [Ping timeout: 252 seconds]
env__ has joined #ocaml
carlosdagos has quit [Quit: Connection closed for inactivity]
env__ has quit [Ping timeout: 246 seconds]
env__ has joined #ocaml
env__ has quit [Ping timeout: 272 seconds]
lambda_ has joined #ocaml
ruffy has joined #ocaml
ruffy is now known as Guest50130
Guest50130 has quit [Client Quit]
ruffy_ has joined #ocaml
env__ has joined #ocaml
env__ has quit [Ping timeout: 252 seconds]
env__ has joined #ocaml
mfp has joined #ocaml
env__ has quit [Ping timeout: 240 seconds]
env__ has joined #ocaml
env__ has quit [Ping timeout: 246 seconds]
ggole has joined #ocaml
env__ has joined #ocaml
pierpal has quit [Ping timeout: 240 seconds]
env__ has quit [Ping timeout: 245 seconds]
env__ has joined #ocaml
marble_visions has quit [Quit: bye]
env__ has quit [Ping timeout: 240 seconds]
marble_visions has joined #ocaml
notnotdan has joined #ocaml
<notnotdan> Hi
<zozozo> hello
ygrek has joined #ocaml
rwmjones|EDI has quit [Ping timeout: 250 seconds]
eagleflo_ is now known as eagleflo
env__ has joined #ocaml
ygrek has quit [Ping timeout: 264 seconds]
env__ has quit [Ping timeout: 246 seconds]
jbrown has quit [Ping timeout: 252 seconds]
env__ has joined #ocaml
env__ has quit [Ping timeout: 245 seconds]
env__ has joined #ocaml
env__ has quit [Ping timeout: 245 seconds]
env__ has joined #ocaml
env__ has quit [Ping timeout: 252 seconds]
silver has joined #ocaml
env__ has joined #ocaml
ShalokShalom has joined #ocaml
env__ has quit [Ping timeout: 244 seconds]
jbrown has joined #ocaml
env__ has joined #ocaml
jbrown has quit [Ping timeout: 264 seconds]
freyr69 has joined #ocaml
env__ has quit [Ping timeout: 240 seconds]
<notnotdan> So I have a question about concurrency libraries for OCaml. I am translating some code from async to Lwt.
remix2000 has joined #ocaml
<notnotdan> Am I correct in understanding that async includes networking capabilities by default, but for Lwt you have to use an external library, such as conduit?
env__ has joined #ocaml
lambda_ has quit [Ping timeout: 252 seconds]
env__ has quit [Ping timeout: 252 seconds]
JimmyRcom has joined #ocaml
<notnotdan> What I mean is that in async it's very easy to make a simple request: https://ocaml.janestreet.com/ocaml-core/latest/doc/async_extra/Async_extra/Tcp/#val-with_connection but with Lwt I had to produce quite some boilerplate, which took me a lot of time to figure out: https://gist.github.com/co-dan/b5b1019afc3363eaf2e8d987c185de07
<notnotdan> I am just wondereing if I am doing something wrong here
env__ has joined #ocaml
<engil> notnotdan: you need to use Lwt_unix
<engil> no need for conduit
env__ has quit [Ping timeout: 245 seconds]
env__ has joined #ocaml
<notnotdan> OK, I will take a look at that module
env__ has quit [Ping timeout: 268 seconds]
<notnotdan> engil: so, for resolution I need to use Lwt_unix.gethostbyname and then construct ADDR_INET out of it and then use Lwt_io functions like Lwt_io.with_connection?
env__ has joined #ocaml
pierpal has joined #ocaml
Guest99354 has joined #ocaml
env__ has quit [Ping timeout: 252 seconds]
jao has joined #ocaml
env__ has joined #ocaml
JimmyRcom has quit [Ping timeout: 252 seconds]
env__ has quit [Ping timeout: 252 seconds]
spew has joined #ocaml
env__ has joined #ocaml
env__ has quit [Ping timeout: 272 seconds]
struktured has joined #ocaml
env__ has joined #ocaml
env__ has quit [Ping timeout: 268 seconds]
maufred has quit [Quit: WeeChat 2.2]
maufred has joined #ocaml
env__ has joined #ocaml
averell has quit [Quit: .]
ygrek has joined #ocaml
env__ has quit [Ping timeout: 250 seconds]
rwmjones has joined #ocaml
averell has joined #ocaml
env__ has joined #ocaml
slamzy has joined #ocaml
env__ has quit [Ping timeout: 246 seconds]
struktured has quit [Quit: Konversation terminated!]
env__ has joined #ocaml
MadcapJake has quit [Quit: MadcapJake]
MadcapJake has joined #ocaml
env__ has quit [Ping timeout: 246 seconds]
MadcapJake has quit [Client Quit]
MadcapJake has joined #ocaml
env__ has joined #ocaml
env__ has quit [Ping timeout: 268 seconds]
slamzy has quit [Remote host closed the connection]
env__ has joined #ocaml
pierpal has quit [Ping timeout: 252 seconds]
env__ has quit [Ping timeout: 268 seconds]
_andre has joined #ocaml
env__ has joined #ocaml
env__ has quit [Ping timeout: 246 seconds]
freyr69 has quit [Remote host closed the connection]
xorpse_ is now known as xorpse
B78lhky7 has joined #ocaml
env__ has joined #ocaml
B78lhky7 has left #ocaml [#ocaml]
pvaibhav has joined #ocaml
pvaibhav has left #ocaml [#ocaml]
pvaibhav has joined #ocaml
<pvaibhav> hi all, what is the recommended way to compare / test equality of user-defined variant types, after opening Base or Containers (which hide the polymorphic = operator)? I couldn’t find clear simple answer by searching on google.
env__ has quit [Ping timeout: 240 seconds]
emily has joined #ocaml
<pvaibhav> e.g.: type planet = Sun | Moon | Earth; writing Sun = Sun or Sun = Moon doesn’t work
<companion_cube> writing a custom equality function
<companion_cube> short term: Pervasives.(=)
<companion_cube> long term: writing planet_equal by yourself or using ppx_deriving
<pvaibhav> companion_cube: thanks. writing a custom equality for variants with 20-30 constructors (e.g. constellation names) is cumbersome. So ppx_deriving is considered good practice in ocaml community?
<pvaibhav> asking because at some point I also want to target e.g. javascript, so wondering what is the best/most portable way
<thizanne> ppx deriving will simply generate that custom equality for you
<thizanne> it will work well with javascript generation
<companion_cube> ppx deriving is not really related to whatever you target , it comes much earlier in the compilation toolchain :)
<pvaibhav> i see. that sounds good
env__ has joined #ocaml
env__ has quit [Ping timeout: 245 seconds]
env__ has joined #ocaml
<ggole> chaotic neutral option: Pervasives.(==)
<ggole> (Don't do that, it only works for this case by accident.)
sagax_ has quit [Quit: Konversation terminated!]
env__ has quit [Ping timeout: 245 seconds]
env__ has joined #ocaml
al-damiri has joined #ocaml
env__ has quit [Ping timeout: 246 seconds]
<lyxia> I would argue that's actually evil.
pierpal has joined #ocaml
frefity has joined #ocaml
<pvaibhav> thanks everyone, I installed ppx_deriving, added to my .merlin and even code completion for the auto-generated function works perfectly in VScode 😁
pierpal has quit [Quit: Poof]
pierpal has joined #ocaml
env__ has joined #ocaml
env__ has quit [Ping timeout: 240 seconds]
aydio has joined #ocaml
aydio has quit [Quit: WeeChat 2.2]
aydio has joined #ocaml
err0ne has quit [Disconnected by services]
err0ne has joined #ocaml
sagotch has quit [Quit: Leaving.]
aydio has quit [Quit: WeeChat 2.2]
pierpal has quit [Ping timeout: 240 seconds]
pierpal has joined #ocaml
aydio has joined #ocaml
erkin has joined #ocaml
bartholin has joined #ocaml
<Leonidas> pvaibhav: isn't your .merlin file generated by dune?
<pvaibhav> no I’m not using any build system (yet)… just utop (+ocamlbuild)
<Leonidas> well, that is also a build system
<Leonidas> ocamlbuild, not utop
<pvaibhav> yes :) but I only ever run ocamlbuild so that merlin will find my other source files
<pvaibhav> I’m only experimenting with some math algorithms .. project has only 2 files
ygrek has quit [Remote host closed the connection]
fraxamo has joined #ocaml
<pvaibhav> Leonidas: thanks for the tip, using Dune was no more work than writing .merlin myself.
pierpal has quit [Read error: Connection reset by peer]
<Leonidas> pvaibhav: also has the advantage that the merlin file now stays up to date with what your compiler is going to use
Guest99354 has quit [Remote host closed the connection]
Haudegen has joined #ocaml
<pvaibhav> yes. only problem is it’s now hardcoding all the paths into the .merlin file, so I can’t check it into the repo and have to rely on dune to regenerate it on a fresh clone
<Leonidas> yeah, never check in .merlin files. There is also no purpose to checking them in
<Leonidas> I think there was some discussion of avoiding merlin files for configuration altogether, so merlin would get the information from some other place but I don't know where that effort went
<pvaibhav> i think autogenerating is totally fine. In the C++ world the build tool generates a “compile_commands.json” file with similar info
env__ has joined #ocaml
pvaibhav has left #ocaml [#ocaml]
pvaibhav has joined #ocaml
apostolis has joined #ocaml
<apostolis> hello, is there a way to turn a string into format4? Scanf.from_string produces format6.
<ggole> format4 is just a specialisation of format6
<ggole> type ('a, 'b, 'c, 'd) format4 = ('a, 'b, 'c, 'c, 'c, 'd) format6
<apostolis> yes, I was expecting that from_string would return format6 that is compatible with format4.
env__ has quit [Ping timeout: 252 seconds]
<ggole> You're using Scanf.format_from_string, right?
<apostolis> yes
<ggole> It takes a second argument that indicates the type. You can just use a format4 for that.
<ggole> eg, Scanf.format_from_string "%d" ("%d" : _ format4)
<apostolis> I am probably doing something stupid. Let me check.
<apostolis> I have to put it into Logs.info.
xuanrui has quit [Remote host closed the connection]
webshinra has quit [Remote host closed the connection]
pvaibhav has quit [Ping timeout: 240 seconds]
slamzy has joined #ocaml
Haudegen has quit [Remote host closed the connection]
pvaibhav has joined #ocaml
pvaibhav has quit [Client Quit]
<apostolis> Yep. thanks ggole
* ggole nods
kakadu_ has joined #ocaml
env__ has joined #ocaml
ggole has quit [Quit: ggole]
fraxamo has quit [Quit: Leaving]
pierpal has joined #ocaml
apostolis has quit [Quit: WeeChat 1.6]
benizac has left #ocaml [#ocaml]
zolk3ri has joined #ocaml
pierpal has quit [Ping timeout: 240 seconds]
zolk3ri has quit [Quit: Lost terminal]
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
GreyFaceNoSpace has joined #ocaml
gareppa has joined #ocaml
oni-on-ion has quit [Ping timeout: 250 seconds]
spew has quit [Quit: going home]
gareppa has quit [Quit: Leaving]
bartholin has quit [Remote host closed the connection]
gareppa has joined #ocaml
gareppa has quit [Client Quit]
kakadu_ has quit [Remote host closed the connection]
nullifidian_ has joined #ocaml
nullifidian has quit [Ping timeout: 260 seconds]
orbifx1 has joined #ocaml
kjak has joined #ocaml
env__ has quit [Ping timeout: 246 seconds]
orbifx1 has quit [Ping timeout: 252 seconds]
aydio has quit [Quit: WeeChat 2.2]
aydio has joined #ocaml
env__ has joined #ocaml
so has quit [Ping timeout: 246 seconds]
carlosdagos has joined #ocaml
pierpa has joined #ocaml
so has joined #ocaml
erkin has quit [Remote host closed the connection]
aydio has quit [Ping timeout: 264 seconds]