bartholin has quit [Read error: Connection reset by peer]
bartholin_ has joined #ocaml
bartholin_ has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
narimiran has joined #ocaml
amiloradovsky has quit [Ping timeout: 250 seconds]
keep_learning has joined #ocaml
keep_learning has quit [Client Quit]
kjak has quit [Ping timeout: 268 seconds]
kjak has joined #ocaml
kjak has quit [Ping timeout: 265 seconds]
ggole has joined #ocaml
Serpent7776 has joined #ocaml
Haudegen has joined #ocaml
dborisog has joined #ocaml
mbuf has joined #ocaml
mbuf has quit [Read error: Connection reset by peer]
count3rmeasure has joined #ocaml
mbuf has joined #ocaml
keep_learning has joined #ocaml
kjak has joined #ocaml
kjak has quit [Ping timeout: 250 seconds]
ygrek has joined #ocaml
jaar has joined #ocaml
jao has joined #ocaml
engil has joined #ocaml
engil has joined #ocaml
kakadu has joined #ocaml
theglass has joined #ocaml
theglass has joined #ocaml
theglass has quit [Changing host]
jao has quit [Ping timeout: 265 seconds]
tizoc has joined #ocaml
mrd has joined #ocaml
cthuluh has joined #ocaml
Nikkel has joined #ocaml
toppler has joined #ocaml
swistak35 has joined #ocaml
crowley95 has joined #ocaml
emias has joined #ocaml
philtor has joined #ocaml
eagleflo has joined #ocaml
_habnabit has joined #ocaml
delysin has joined #ocaml
Amaan has joined #ocaml
lobo has joined #ocaml
mrd is now known as Guest87253
greenbagels has joined #ocaml
crowley95 is now known as Guest68587
Niamkik has joined #ocaml
maker has joined #ocaml
chindy has joined #ocaml
lobo is now known as Guest37567
Niamkik is now known as Guest4
kleisli has joined #ocaml
slice has joined #ocaml
iAmerikan has joined #ocaml
kark has joined #ocaml
kakadu has quit [Ping timeout: 252 seconds]
kakadu has joined #ocaml
stux|RC has quit [Read error: Connection reset by peer]
catern has joined #ocaml
stux|RC has joined #ocaml
rotucer has joined #ocaml
kakadu has quit [Ping timeout: 245 seconds]
kakadu_ has joined #ocaml
rotucer has quit [Quit: Quit]
iAmerikan has quit [Quit: WeeChat 2.6]
andrewalker has quit [Quit: ZNC 1.6.2 - http://znc.in]
<Nikkel>
Is there any way to compare abstract data types in Ocaml?
<Nikkel>
sorry algebraic
<vsiles>
Nikkel: I think you can't avoid defining the comparison function yourself (or generate one with ppx ord or something like that)
<zozozo>
Nikkel: the polymorphic comparison works on algebraic datatypes generally, but if you need a precise behavior (such as ignoring some field), you'll need to define the comparison function yourself
<Nikkel>
zozozo: dang
<Nikkel>
I basically just use the ADT as an enum
<Nikkel>
no field contents
<Nikkel>
zozozo: I just used compare :) it works, thanks
<zozozo>
if it's just an enum, the poly compare will wokr fine, ^^
<zozozo>
(it will just be a bit slower than a hand-written one, but it shouldn't matter)
free_beard has joined #ocaml
gareppa has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
ofzyh has quit [Remote host closed the connection]
<vsiles>
zozozo: good to know
kakadu_ has quit [Ping timeout: 245 seconds]
kakadu has joined #ocaml
jaar has quit [Ping timeout: 250 seconds]
jaar has joined #ocaml
Haudegen has joined #ocaml
jaar_ has joined #ocaml
jaar has quit [Ping timeout: 248 seconds]
Guest4 has quit [Quit: WeeChat 2.6]
Niamkik has joined #ocaml
kakadu has quit [Ping timeout: 245 seconds]
kakadu_ has joined #ocaml
<zozozo>
Nikkel: so I did some benchs, and it looks like a handwritten comparison function (either through enumerating the quadratic number of cases, or using a discriminant function), is about twice as fast as the polymorphic compare (see https://gist.github.com/Gbury/0320133b9ce3422341e54b4b2e3fdc15#file-comp-res-L1 )
<zozozo>
the poly compare is alreayd quite fast and most likely not to be a bottleneck though
<ggole>
Hmm, why the match in discr? The result is the same if you just unconditionally do _discr a - _discr b
<zozozo>
ggole:right, I just ahve the habig of algebraic types with arguments (in which case you want to call some comparison functions on the arguments of constructors)
<zozozo>
(and it seems I can't type without typos anymore, :p )
<ggole>
Well, the point is that I don't think any of those comparisons are as efficient as they could be
<zozozo>
ggole:let me try the discr without match
<ggole>
You might want to try something like let stdlib (a : t) b = Pervasives.compare a b, since the compiler recognises comparisons of an integral type (if the type is obvious at the site of comparison)
<zozozo>
from what I recall, the compiler recognizes comparisons between builtin types, but not "integral types" (but I could misremember or just be wrong, ^^)
<ggole>
It considers a datatype with all nullary constructors to be integral.
<zozozo>
ggole: indeed you're right, with the type annotations, all functions perform basically the same
luna_is_here has joined #ocaml
gareppa has quit [Quit: Leaving]
count3rmeasure has quit [Quit: Leaving]
andreas303 has quit [Ping timeout: 260 seconds]
andreas303 has joined #ocaml
sagax has quit [Ping timeout: 252 seconds]
FreeBirdLjj has joined #ocaml
greenbagels has quit [Changing host]
greenbagels has joined #ocaml
spew has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 248 seconds]
sagax has joined #ocaml
<Nikkel>
Is it possible to print output within a QCheck test?
jao has joined #ocaml
oni-on-ion has joined #ocaml
<spew>
you can just print stuff yes
<spew>
sometimes I do that if I'm really confused
<spew>
you get a lot of noise
<spew>
best person to ask is companion_cube I would think
FreeBirdLjj has joined #ocaml
<companion_cube>
Nikkel: depends on the test runner, I think
<companion_cube>
alcotest tends to store output somewhere
vicfred has quit [Quit: Leaving]
FreeBirdLjj has quit [Ping timeout: 250 seconds]
mbuf has quit [Remote host closed the connection]
<spew>
yeah I was just using QCheck_runner.run_tests
betux has joined #ocaml
smazga has joined #ocaml
<Nikkel>
companion_cube: Okay. Thanks :)
<Nikkel>
Is there any way I can trigger af Js_of_ocaml call to happen after every React model step?
brettgilio has quit [Ping timeout: 245 seconds]
Guest37567 is now known as lobo
lobo is now known as Guest52304
Guest52304 has quit [Changing host]
Guest52304 has joined #ocaml
Guest52304 is now known as lobo
ziyourenxiang has quit [Ping timeout: 268 seconds]
free_beard has quit [Remote host closed the connection]
Haudegen has quit [Quit: Bin weg.]
Serpent7776 has quit [Quit: Leaving]
yomimono has quit [Ping timeout: 276 seconds]
betux has quit [Quit: betux]
betux1 has joined #ocaml
betux1 is now known as betux
dborisog has quit [Ping timeout: 265 seconds]
mononote- has joined #ocaml
mononote has left #ocaml ["Disconnected: Received SIGTERM"]
mononote- is now known as mononote
smazga has quit [Quit: leaving]
Haudegen has joined #ocaml
oni-on-ion has quit [Remote host closed the connection]
Serpent7776 has joined #ocaml
bartholin has joined #ocaml
gravicappa has quit [Ping timeout: 265 seconds]
jaar_ has quit [Ping timeout: 248 seconds]
jnavila has joined #ocaml
ggole has quit [Quit: Leaving]
TheLemonMan has joined #ocaml
gareppa has joined #ocaml
rosterok has joined #ocaml
narimiran has quit [Ping timeout: 246 seconds]
brettgilio has joined #ocaml
kark has quit [Remote host closed the connection]
kleisli has quit [Ping timeout: 268 seconds]
ygrek has quit [Ping timeout: 265 seconds]
betux has quit [Ping timeout: 276 seconds]
brettgil` has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
gareppa has quit [Quit: Leaving]
Haudegen has joined #ocaml
jnavila has quit [Remote host closed the connection]
Hrundi_V_Bakshi has joined #ocaml
Haudegen has quit [Quit: No Ping reply in 180 seconds.]
Haudegen has joined #ocaml
bronsen has quit [Quit: WeeChat 2.6]
bronsen has joined #ocaml
grandy______ has joined #ocaml
grandy______ has quit [Client Quit]
isd has joined #ocaml
<isd>
Hey all. I've some code examples in the wild using an open! construct. What does the exclamation point do? I haven't been able to find info on that.