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
Algebr has joined #ocaml
Algebr has quit [Remote host closed the connection]
Denommus has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
sh0t has quit [Remote host closed the connection]
zpe has joined #ocaml
infinity0_ has joined #ocaml
infinity0 is now known as Guest21265
infinity0_ has joined #ocaml
Guest21265 has quit [Killed (hitchcock.freenode.net (Nickname regained by services))]
infinity0_ is now known as infinity0
cbot has joined #ocaml
<infinity0> QCheck.(triple (string_of_size (Gen.return (deg/8))) (int_range 1 100) (int_range 1 100))
<infinity0> this is passing the example ("", 0, 0) to my test for some reason
<infinity0> i thought the point of those restricted-Gens was to not pass non-matching values to the test?
<infinity0> atm i have to guard it with "if (a > 0) || (b > 0) || (String.length secret <> deg / 8) then true else"
<zozozo> infinity0: well, your generator generates each element of the triplet independently, so of course ("", 0, 0) is a valid generated value, I'd say you can either use preconditions to filter out invalid inputs (cee https://github.com/c-cube/qcheck#preconditions), or write your own custom generator if those invalid input are too common
dtornabene has joined #ocaml
<infinity0> zozozo: but my generator is "string_of_size (positive)", why does it generate 0 even if it's generated independently of the others?
<zozozo> infinity0: because 0 is positive ?
<infinity0> generate "" rather
<infinity0> "" has 0 size which is definitely not positive
<zozozo> well, depends on conventions I guess (or rather on whether the author is french, unfortunately)
<companion_cube> ah, again this weird english definition of `positive` :3
<zozozo> ^^
<infinity0> anyway my code for that part does not return 0
<infinity0> and (int_range 1 100) for sure should not be generating 0
<companion_cube> infinity0: is it on a failing test?
<companion_cube> it might be caused by shrinking
<companion_cube> you start with a triple generated by your generator, then the test fails
<companion_cube> then the triple is shrunk down to "",0,0
<infinity0> companion_cube: the error message mentions shrinking but when i add a bunch of "assume" then nothing fails
<companion_cube> you mean, if you put assume, the test succeeds
<infinity0> right
<companion_cube> but if you don't, it's given values that don't satisfy the condition?
<companion_cube> weird indeed
<infinity0> can i tell it not to shrink down to "",0,0
<companion_cube> there should be no shrinking unless a test fails, anyway
<companion_cube> (but no, sorry :/ there's only assume for that)
<companion_cube> well, on 100_000 samples I can't get a triple with (_,0,_) or (_,_,0)…
<zozozo> companion_cube: well, one could always write a custom generator and shrinker to avoid "",0,0 but that seems harder than just using assume I guess
<companion_cube> yeah, also assume is more robust in the end
gtrak has joined #ocaml
<infinity0> if you guys want to take a look it's this code https://github.com/infinity0/ocaml-secret-sharing/blob/master/qcheck/test.ml#L112
<infinity0> oh wait i messed up the assume
<companion_cube> oh wait, you can also use QCheck.Shrink.filter on the shrink function
<companion_cube> (to remove shrunk values that do not satisfy a predicate)
sh0t has joined #ocaml
jbrown has quit [Quit: Leaving]
<infinity0> yeah was due to unseeded generator, seems ok now
ziyourenxiang has joined #ocaml
bruce_r has joined #ocaml
gtrak has quit [Ping timeout: 264 seconds]
cbot has quit [Quit: Leaving]
bruce_r has quit [Ping timeout: 240 seconds]
zolk3ri has quit [Remote host closed the connection]
isd has quit [Quit: Leaving.]
mfp has quit [Ping timeout: 268 seconds]
navaja has joined #ocaml
jonh has left #ocaml ["WeeChat 0.4.2"]
navaja has quit [Ping timeout: 268 seconds]
govg has joined #ocaml
sh0t has quit [Remote host closed the connection]
navaja has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
navaja has quit [Read error: Connection reset by peer]
navaja has joined #ocaml
FreeBirdLjj has joined #ocaml
bruce_r has joined #ocaml
navaja has quit [Read error: Connection reset by peer]
noddy has joined #ocaml
bruce_r has quit [Ping timeout: 256 seconds]
<companion_cube> rgr[m]: is that normal that executables can't be `optional`?
<rgr[m]> I'm aware that's the case.
<rgr[m]> It's best to avoid this optional stuff. There's usually a better way to handle things.
jao has quit [Ping timeout: 240 seconds]
<companion_cube> yeha, I guess…
<companion_cube> unrelated, but I'm having a hard time chasing a segfault with C stubs in linenoise ;_;
<zaltekk> i've been looking into lablgtk and it seems to only support gtk2. are people just using FFI directly to use gtk3? or is lablgtk still the way to go?
al-damiri has quit [Quit: Connection closed for inactivity]
Pierpa has quit [Quit: Page closed]
FrankyCyborg has joined #ocaml
<FrankyCyborg> hello! to make a long story short: can someone confirm, that at least one of the libraries that's installed with ocaml contains the symbol caml_builtin_cprim ? along with some others (but I already identified the object file to include in the compilation command to find them), it's completely missing and a look into the build log of ocaml (version 4.05.0) shows, that the object file byterun/prims.o, which stores them, is never built
<FrankyCyborg> into any library file - it's only used to compile the program byterun/ocamlrun .
noddy has quit [Ping timeout: 260 seconds]
bruce_r has joined #ocaml
xuanrui has joined #ocaml
<companion_cube> it seems it's an array
<companion_cube> never seen it before though
<FrankyCyborg> yep, an array, but: nm /opt/local/lib/ocaml/libcamlrun.a | grep cprim gives me U _caml_builtin_cprim
<FrankyCyborg> the file prims.c which is generated via script should be generated and compiled before libcamlrun.a is created.
<FrankyCyborg> so that it can be linked into libcamlrun.a .
<FrankyCyborg> ah yes, the joy of changing Makefiles... =)
<companion_cube> just wondering, what do you need this for?
<FrankyCyborg> it's referenced by another part of ocaml: Undefined symbols for architecture x86_64: "_caml_builtin_cprim", referenced from: _caml_build_primitive_table in libcamlrun.a(dynlink.o) which is needed to compile clang with ocaml support.
<FrankyCyborg> the build process of clang complains about many missing symbols, because the compilation command does not include the licamlrun.a file; an error which I already fixed.
<FrankyCyborg> such as _caml_alloc, _caml_alloc_custom, etc.. i could upload the build log file somewhere, if you wish. would make things easier, perhaps!?
<companion_cube> i don't know
<companion_cube> tbh it's friday night and I've also spent the day trying to fix C interop issues :/
<FrankyCyborg> well, this issue is nothing that I cannot fix - but it's something that should be known upstream, as it would certainly bite someone else in the future
kakadu has joined #ocaml
<FrankyCyborg> ok, in case someone is interested in the "bug report" and the contained patch for this issue: https://hastebin.com/raw/urugamesav i'm really wondering why this hasn't been observed by anyone else!? could mean, that the functions which use this array are never called!? hm, strange enough, but then, i'm no ocaml developer (yet), therefore i'm just glad I can continue to compile LLVM and CLang.
govg has quit [Ping timeout: 256 seconds]
jimmyrcom has joined #ocaml
trochdewei has joined #ocaml
xuanrui has quit [Quit: Leaving]
sz0 has joined #ocaml
jimmyrcom has quit [Ping timeout: 264 seconds]
dedgrant has quit [Ping timeout: 248 seconds]
jimmyrcom has joined #ocaml
trochdewei has quit [Remote host closed the connection]
ygrek has joined #ocaml
trochdewei has joined #ocaml
trochdewei has quit [Remote host closed the connection]
bruce_r has quit [Ping timeout: 256 seconds]
tarptaeya has joined #ocaml
zlsyx has joined #ocaml
andreas_ has quit [Quit: Connection closed for inactivity]
andreas_ has joined #ocaml
zlsyx has quit [Quit: Leaving...]
mfp has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
argent_smith has joined #ocaml
FreeBirdLjj has joined #ocaml
<bartholin> type 'a foo = Foo of ('a foo -> 'a);;
<bartholin> let f x = match x with Foo g -> g x;;
<bartholin> let x = Foo f;;
<bartholin> let () = f x;;
<bartholin> ( ͡° ͜ʖ ͡°)
FreeBirdLjj has quit [Ping timeout: 245 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
inr has quit [Quit: WeeChat 2.0.1]
inr has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
Guest93958 has joined #ocaml
tane_ has joined #ocaml
Guest93958 is now known as Haudegen
ygrek has quit [Ping timeout: 240 seconds]
andreas_ has quit [Quit: Connection closed for inactivity]
zolk3ri has joined #ocaml
Denommus has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
webshinra has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 264 seconds]
FrankyCyborg has quit [Quit: FrankyCyborg]
FreeBirdLjj has joined #ocaml
noddy has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 252 seconds]
assos has joined #ocaml
govg has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
noddy has quit [Ping timeout: 252 seconds]
noddy has joined #ocaml
FreeBirdLjj has joined #ocaml
tarptaeya has quit [Ping timeout: 245 seconds]
FreeBirdLjj has quit [Ping timeout: 256 seconds]
noddy has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
noddy has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
sh0t has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 268 seconds]
FreeBirdLjj has joined #ocaml
GreyFaceNoSpace has joined #ocaml
jimmyrcom has quit [Ping timeout: 264 seconds]
GreyFaceNoSpace has quit [Read error: No route to host]
GreyFaceNoSpace has joined #ocaml
<GreyFaceNoSpace> hi guys. i am a beginner to ocaml and was trying to implement belman-ford shortest path algorithm using ocaml as practice and was wondering if someone can help me fix some problems with my code. https://pastebin.com/mAQ3ZXAD
navaja has joined #ocaml
navaja has quit [Ping timeout: 256 seconds]
navaja has joined #ocaml
jonh has joined #ocaml
sh0t has quit [Ping timeout: 248 seconds]
navaja has quit [Read error: Connection reset by peer]
dtornabene has quit [Quit: Leaving]
<bartholin> GreyFaceNoSpace: what is your problem?
<GreyFaceNoSpace> bartholin, the shortest path output by my algorithm is wrong
<GreyFaceNoSpace> for node 2
<GreyFaceNoSpace> can you have a look at it, maybe there's something i am missing
<GreyFaceNoSpace> also can you maybe tell me how to make it less ugly?
<GreyFaceNoSpace> because i am struggling with writing clean code when it comes to functionally programming
<GreyFaceNoSpace> as you can see the graph i ran the algorithm on is very simple
<GreyFaceNoSpace> for node 2 i should get a shortest distance of 1.7 and a predecessor node 4.
<GreyFaceNoSpace> what i get instead is a distance of infinity and no predecessor
<bartholin> GreyFaceNoSpace: it is a directed graph, and there is no way to go from 0 to 2.
<GreyFaceNoSpace> bartholin, through node 4 and 1
<GreyFaceNoSpace> just like from 3 to 0. u go through node 1
<GreyFaceNoSpace> with a distance of 0.7
<bartholin> 0 -> 1, 1 -> 3, 1 -> 4, 2 -> 4
<GreyFaceNoSpace> bartholin, 0 -> 1 , 1 -> 3, 1-> 4, 4 -> 2
<GreyFaceNoSpace> thats my graph
noddy has quit [Ping timeout: 240 seconds]
<GreyFaceNoSpace> ohh.
<bartholin> [(2, (Some 4, 1.70000000000000018)); (4, (Some 1, 1.3)); (3, (Some 1, 0.7)); (1, (Some 0, 0.5)); (0, (None, 0.))]
<GreyFaceNoSpace> how did u get that output?
<bartholin> your definition of graph is wrong
<bartholin> let graph = [(0, 0.5, 1); (1, 0.2, 3); (1, 0.8, 4); (4, 0.4, 2)]
<GreyFaceNoSpace> woops
<GreyFaceNoSpace> yea
<GreyFaceNoSpace> u are right
<GreyFaceNoSpace> sorry and thanks
<GreyFaceNoSpace> i didn't notice
<GreyFaceNoSpace> was too focused on my algorith,
<GreyFaceNoSpace> thank you very much
<GreyFaceNoSpace> bartholin, how can i make my code less ugly if i might ask
noddy has joined #ocaml
<bartholin> add comments
noddy has quit [Read error: Connection reset by peer]
noddy has joined #ocaml
noddy has quit [Read error: Connection reset by peer]
tarptaeya has joined #ocaml
<bartholin> GreyFaceNoSpace: I did some minor changes https://p.teknik.io/T5YCR
<GreyFaceNoSpace> bartholin, thanks ... yours is much cleaner
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 265 seconds]
ilovezfs_ has quit [Ping timeout: 252 seconds]
dch has quit [Read error: Connection reset by peer]
dch has joined #ocaml
ilovezfs_ has joined #ocaml
ziyourenxiang has quit [Ping timeout: 264 seconds]
hannes` is now known as hannes
Haudegen has quit [Ping timeout: 256 seconds]
kakadu_ has quit [Read error: Connection reset by peer]
kakadu_ has joined #ocaml
etc_ has joined #ocaml
TheLemonMan has joined #ocaml
<etc_> Hi! I'm trying to write a ppx that uses some type checking information. Can one get the typechecker to run within a ppx? I'm specifically trying to resolve a module name to a module signature. Alternatively, is there a ppx-like infrastructure for typedtree's? Thanks in advance for any help!
GreyFaceNoSpace has quit [Read error: No route to host]
<kakadu_> there are ocaml plugins that allow rewriting of typed tree
<kakadu_> google this plugin stuff
<etc_> Interesting - I found TypeMod.ImplementationHooks which might work! Is that what you're thinking of?
<kakadu_> yep
<etc_> Great - thank you!
govg has quit [Ping timeout: 264 seconds]
govg has joined #ocaml
terrorjack has quit [Read error: Connection reset by peer]
terrorjack has joined #ocaml
* smondet[m] sent a long message: smondet[m]_2018-03-10_18:20:05.txt <https://matrix.org/_matrix/media/v1/download/matrix.org/wGUmmhXkFKBJjascuAgmEjHL>
<etc_> smondet: I saw that! Thanks - that's definitely useful, I'm a little concerned that it doesn't work with a repl but I'm not sure how big a problem that will end up being
bruce_r has joined #ocaml
bruce_r has quit [Ping timeout: 240 seconds]
TC01 has joined #ocaml
etc_ has quit [Ping timeout: 260 seconds]
andreas_ has joined #ocaml
sh0t has joined #ocaml
zpe has quit [Remote host closed the connection]
bruce_r has joined #ocaml
slash^ has joined #ocaml
sh0t has quit [Remote host closed the connection]
sh0t has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
isd has joined #ocaml
bruce_r has quit [Ping timeout: 256 seconds]
slash^ has quit [Read error: Connection reset by peer]
bruce_r has joined #ocaml
jimmyrcom has joined #ocaml
bruce_r has quit [Ping timeout: 256 seconds]
nkhodyunya has quit [Quit: removing from IRC because user idle on matrix for 30+ days]
rizo[m] has left #ocaml ["Kicked by @appservice-irc:matrix.org : removing from IRC because user idle on matrix for 30+ days"]
isd has quit [Ping timeout: 264 seconds]
jnavila has joined #ocaml
isd has joined #ocaml
webshinra has joined #ocaml
andreas_ has quit [Quit: Connection closed for inactivity]
jnavila has quit [Remote host closed the connection]
M-x-matrix[m] has quit [Quit: removing from IRC because user idle on matrix for 30+ days]
zpe has joined #ocaml
noddy has joined #ocaml
noddy has quit [Read error: Connection reset by peer]
noddy has joined #ocaml
silver has joined #ocaml
argent_smith has quit [Quit: Leaving.]
jimmyrcom has quit [Ping timeout: 255 seconds]
dedgrant has joined #ocaml
noddy has quit [Ping timeout: 256 seconds]
zv has quit [Ping timeout: 256 seconds]
bruce_r has joined #ocaml
kakadu_ has quit [Remote host closed the connection]
pierpa_ has joined #ocaml
mk9 has joined #ocaml
sh0t has quit [Ping timeout: 264 seconds]
zmt01 has joined #ocaml
zmt00 has quit [Read error: Connection reset by peer]
Bronsa has quit [Read error: Connection reset by peer]
zmt01 has quit [Remote host closed the connection]
zmt00 has joined #ocaml
kark has joined #ocaml
mk9 has quit [Quit: mk9]
vbmithr_ has quit [Ping timeout: 240 seconds]
vbmithr has joined #ocaml
zv has joined #ocaml
jimmyrcom has joined #ocaml
tane_ has quit [Quit: Leaving]
tarptaeya has quit [Quit: Leaving]
silver_ has joined #ocaml
silver has quit [Read error: Connection reset by peer]
bruce_r has quit [Ping timeout: 260 seconds]
bruce_r has joined #ocaml
zolk3ri has quit [Remote host closed the connection]
isd has quit [Ping timeout: 255 seconds]
bruce_r has quit [Ping timeout: 255 seconds]