adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Current MOOC: https://huit.re/ocamlmooc | OCaml 4.04.0 release notes: http://ocaml.org/releases/4.04.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
<orbitz> I think I figured it out, thanks.
vramana has joined #ocaml
<companion_cube> so, the very new qtest has no api, it's just a parser+code generator
<companion_cube> random tests are to be written using qcheck
<companion_cube> sorry about the mess
<companion_cube> I'll udpate containers soon
ryanartecona has joined #ocaml
<orbitz> companion_cube: when will the magic happen? a week?
<companion_cube> it's already there, in theory, on master
<companion_cube> I'll try to do it asap.
<companion_cube> orbitz: ok, well, https://github.com/ocaml/opam-repository/pull/8124 ;-)
<companion_cube> hopefully it will fix the issue
zirman has quit [Remote host closed the connection]
whisperedcigar has joined #ocaml
whisperedcigar has quit [Ping timeout: 245 seconds]
testml has joined #ocaml
<testml> hi
<testml> who is maintaining ppx_deriving here?
<orbitz> companion_cube: thanks :)
<orbitz> testml: I don't think he's here, bu tI think it's whitespark
<testml> i see, thanks
<companion_cube> whitequark
<orbitz> d'oh
<orbitz> But I was right, he isn't here!
zirman has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
ryanartecona has quit [Quit: ryanartecona]
chindy has joined #ocaml
ryanartecona has joined #ocaml
unbalanced has joined #ocaml
FreeBirdLjj has joined #ocaml
trepta7 has quit [Ping timeout: 258 seconds]
chindy has quit [Quit: Leaving]
zirman has quit [Remote host closed the connection]
FreeBirdLjj has quit [Ping timeout: 260 seconds]
f[x] has quit [Ping timeout: 264 seconds]
whisperedcigar has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
whisperedcigar has quit [Ping timeout: 245 seconds]
wu_ng has joined #ocaml
programo has joined #ocaml
zirman has joined #ocaml
silver has quit [Read error: Connection reset by peer]
zirman has quit [Remote host closed the connection]
zirman has joined #ocaml
mfp has quit [Ping timeout: 240 seconds]
pierpa has quit [Ping timeout: 256 seconds]
ryanartecona has joined #ocaml
ryanartecona has quit [Client Quit]
jlongster has joined #ocaml
vicfred has quit [Quit: Leaving]
wu_ng has quit [Ping timeout: 248 seconds]
infinity0 has quit [Remote host closed the connection]
wu_ng has joined #ocaml
infinity0 has joined #ocaml
whisperedcigar has joined #ocaml
zirman has quit [Remote host closed the connection]
nomicflux has quit [Quit: nomicflux]
whisperedcigar has quit [Ping timeout: 245 seconds]
MetaHertz has joined #ocaml
jao has joined #ocaml
jlongster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tristero has quit [Quit: WeeChat 1.6]
tristero has joined #ocaml
vramana has quit [Remote host closed the connection]
myst|fon has quit [Quit: Connection closed for inactivity]
ryanartecona has joined #ocaml
f[x] has joined #ocaml
f[x] has quit [Ping timeout: 256 seconds]
ryanartecona has quit [Quit: ryanartecona]
zirman has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
infinity0 has quit [Ping timeout: 258 seconds]
jao has quit [Ping timeout: 265 seconds]
zirman has quit [Ping timeout: 252 seconds]
infinity0 has joined #ocaml
wu_ng has quit [Ping timeout: 252 seconds]
wu_ng has joined #ocaml
wu_ng has quit [Ping timeout: 248 seconds]
wu_ng has joined #ocaml
unbalanced has quit [Ping timeout: 258 seconds]
tmtwd has joined #ocaml
ryanartecona has joined #ocaml
whisperedcigar has joined #ocaml
whisperedcigar has quit [Ping timeout: 245 seconds]
d0nn1e has quit [Ping timeout: 250 seconds]
d0nn1e has joined #ocaml
f[x] has joined #ocaml
cataska has joined #ocaml
noddy2OOO has quit [Ping timeout: 240 seconds]
f[x] has quit [Ping timeout: 265 seconds]
cataska has quit [Quit: Textual IRC Client: www.textualapp.com]
whisperedcigar has joined #ocaml
whisperedcigar has quit [Ping timeout: 245 seconds]
vramana has joined #ocaml
noddy2OOO has joined #ocaml
copy` has quit [Quit: Connection closed for inactivity]
sz0 has joined #ocaml
chetshah_ has joined #ocaml
Simn has joined #ocaml
MercurialAlchemi has joined #ocaml
troydm has joined #ocaml
chetshah_ has quit [Ping timeout: 260 seconds]
ryanartecona has quit [Quit: ryanartecona]
madroach has quit [Quit: leaving]
programo has quit [Remote host closed the connection]
argent_smith has joined #ocaml
ziyourenxiang has quit [Quit: Leaving]
infinity0 has quit [Remote host closed the connection]
scitesy has joined #ocaml
slash^ has joined #ocaml
infinity0 has joined #ocaml
zirman has joined #ocaml
scitesy has quit [Read error: No route to host]
scitesy has joined #ocaml
zirman has quit [Ping timeout: 256 seconds]
infinity0 has quit [Ping timeout: 264 seconds]
whisperedcigar has joined #ocaml
rgrinberg has quit [Ping timeout: 250 seconds]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
whisperedcigar has quit [Ping timeout: 245 seconds]
whisperedcigar has joined #ocaml
zirman has joined #ocaml
whisperedcigar has quit [Client Quit]
zirman has quit [Ping timeout: 265 seconds]
larhat has joined #ocaml
trepta7 has joined #ocaml
tmtwd has quit [Quit: Leaving]
Flerex has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 258 seconds]
jnavila has joined #ocaml
Simn has quit [Quit: Leaving]
trepta7 has quit [Ping timeout: 258 seconds]
Muzer has quit [Ping timeout: 264 seconds]
michbad has joined #ocaml
<Flerex> Hello.
<Flerex> I'm trying to create a function that given a list of a single pair [(x,y)] generates all possible paths.
<Flerex> To do this I'm trying to use a function that I have already created that receives a list of pairs, gets the head one, computes all possible next pairs for the head, and returns a list of lists where the lists are just the previous list with all possible next pairs prepended, or an empty list if there's no possible next element for the given list of pairs.
<Flerex> For example, if the next possible elements for (1,2) are (3,4) and (5,6), this function would receive a list as [(1,2);(8,9);...] and would return [[(3,4);(1,2);(8,9);...];[(5,6);(1,2);(8,9);...]].
<Flerex> If the possible next pairs is any, it would return [].
<Flerex> My problem is that I can't think of a function that does this kind of recursivity with all possible paths until the head of a path returns no next pair. Can anyone help me?
<Flerex> If it's of any help, the code for this function that creates a path with the next element (if any) is: http://pastebin.com/4KNF8s7n
zirman has joined #ocaml
octachron has joined #ocaml
zirman has quit [Ping timeout: 256 seconds]
<lyxia> do you have to use that function
<Flerex> No, I thought it would make thinks easier but it's not compulsory.
<Flerex> things*
<lyxia> So, l is a list of pairs, and possible_squares_by_path computes the possible new elements to append?
edwin has left #ocaml [#ocaml]
<Flerex> I'm sorry, the function that I described is this one, the one you're talking about: http://pastebin.com/qwtvHS5i
<lyxia> okay so, given a path l, you can apply that generate_possible_paths, getting a list ps of paths extended from l
<lyxia> then you can recursively call your pathfinding function on all paths of p
<Flerex> Yes
<lyxia> Does that make sense
<Flerex> I think it does. I'm trying to translate what you said in code.
MercurialAlchemi has joined #ocaml
<Flerex> okay lyxia, I got here: http://pastebin.com/dEQquWXX But I only get the long paths for the first element. I know that I have to use recursivity with aux but I don't know how.
<Flerex> If I simply do generate_possible_paths n m h @ aux t I get this error:
<Flerex> Error: This expression has type (int * int) list list
<Flerex> but an expression was expected of type (int * int) list
<Flerex> Type (int * int) list is not compatible with type int * int
<octachron> Flerex, if I understand correctly, starting from a path p, the new possible paths depend only on the last state of the path?
jnavila has quit [Ping timeout: 256 seconds]
<Flerex> Yes, which is the head.
<octachron> in this case, it is probably simpler to write a function state -> path list
<octachron> with path = state list
<Flerex> Isn't possible_squares_by_path what you mean?
<Flerex> I'd need, tho, the list to check if the next position is not repeated.
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
<octachron> Flerex, your possible_square list computes the list of possible states next to the current state, isn't it?
<Flerex> Yes
<Flerex> I can link you all the code if you want
<octachron> then a way to solve your problem is to write a function that computes from a state the list of all paths possibles from this state
<octachron> : if you have a state s, first compute the possible next state nexts, from each next state computes the list of possible paths starting from this point, append s to all these paths
<Flerex> I think I'm not understanding you.
<Flerex> Is this what you mean? http://i.imgur.com/yt5lx6P.png
sz0 has quit [Quit: Connection closed for inactivity]
<Flerex> These are all the functions I have available: http://pastebin.com/kjc98Fvu
<lyxia> Flerex: generate_possible_paths does one step. Then apply aux recursively to each resulting path to take care of unrolling the remaining steps
jnavila has joined #ocaml
myst|fon has joined #ocaml
mfp has joined #ocaml
rand__ has joined #ocaml
<Flerex> lyxia: That's what I'm trying to accomplish right now here: http://pastebin.com/dEQquWXX but I don't know how to call the recursivity. If I concatenate aux t to generate_possible_paths n m h I get an error that says that t is of type pair list list instead of pair list.
ziyourenxiang has joined #ocaml
<octachron> Flerex, what are supposed to be the input and output of your aux function?
<Flerex> It should receive an initial list with one node [(x,y)] and return all the possible paths of max size (i.e., whose head has no more "next nodes")
<Flerex> I think it should receive a list of lists instead to make the recursivity viable
<lyxia> "apply to each" is map
<octachron> Flerex, note that in general, if you have for precondition a list with exactly one element, you probably do not want a list as an input but the element itself
<lyxia> It's the "one element" constraint that's too strong here
<Flerex> Thanks octachron. I just don't know what I'm doing. I'm really bad at this.
<Flerex> I'm trying to use map now.
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
<octachron> Flerex, also, if your objective is to compute all possible knight tours, there are easier way to do this
<Flerex> Don't tell me that now octachron. You'll make my cry hahhaha
<octachron> Flerex, you should exploit the fact that you know the lenght of knight tours
<octachron> which mean that if you have a function that compute valid paths of lenght (l+1) from path of lenght l, you know that you need to apply this function (n*m) time to get all possible tours
andyc has quit [Ping timeout: 244 seconds]
michbad has quit [Ping timeout: 260 seconds]
andyc has joined #ocaml
<testml> is it possible to conditionally include modules in oasis ?
maattdd has joined #ocaml
silver has joined #ocaml
maattdd has quit [Ping timeout: 258 seconds]
larhat has quit [Read error: Connection reset by peer]
sz0 has joined #ocaml
larhat has joined #ocaml
MetaHertz has quit [Remote host closed the connection]
cic has quit [Quit: WeeChat 1.4]
michbad has joined #ocaml
michbad_ has joined #ocaml
michbad__ has joined #ocaml
michbad has quit [Ping timeout: 268 seconds]
michbad_ has quit [Ping timeout: 265 seconds]
tane has joined #ocaml
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jnavila has quit [Ping timeout: 260 seconds]
jao has joined #ocaml
jao has quit [Changing host]
jao has joined #ocaml
jao has quit [Quit: ERC (IRC client for Emacs 26.0.50.1)]
rand__ has quit [Quit: leaving]
fraggle_ has quit [Remote host closed the connection]
zirman has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
unbalanced has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
tane has quit [Quit: Leaving]
ryanartecona has joined #ocaml
fraggle_ has joined #ocaml
chindy has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
Flerex has joined #ocaml
zirman has quit [Remote host closed the connection]
Flerex has quit [Quit: Textual IRC Client: www.textualapp.com]
zirman has joined #ocaml
zirman has quit [Remote host closed the connection]
zirman has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
jnavila has joined #ocaml
jnavila has quit [Ping timeout: 256 seconds]
jnavila has joined #ocaml
zirman has quit [Remote host closed the connection]
<testml> can i get some help on using ppx_optcomp?
<testml> i get syntax errors for every extensions
nomicflux has joined #ocaml
chindy has quit [Remote host closed the connection]
zapu has quit [Ping timeout: 244 seconds]
vbmithr has quit [Ping timeout: 250 seconds]
fds has quit [Ping timeout: 250 seconds]
Nazral has quit [Ping timeout: 268 seconds]
ia0 has quit [Ping timeout: 250 seconds]
Nazral has joined #ocaml
ia0 has joined #ocaml
fds has joined #ocaml
zapu has joined #ocaml
vbmithr has joined #ocaml
scitesy has quit [Ping timeout: 264 seconds]
shinnya has joined #ocaml
<testml> seems like the package is broken
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
jhaberku has joined #ocaml
diphuser has joined #ocaml
noddy2OOO has quit [Quit: WeeChat 1.6]
scitesy has joined #ocaml
chindy has joined #ocaml
jnavila has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
pierpa has joined #ocaml
Simn has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
jnavila has joined #ocaml
testml has quit [Quit: Page closed]
govg has joined #ocaml
chindy has quit [Remote host closed the connection]
ziyourenxiang has quit [Quit: Leaving]
Simn has quit [Read error: Connection reset by peer]
FreeBirdLjj has joined #ocaml
tane has joined #ocaml
jhaberku has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 245 seconds]
infinity0 has quit [Ping timeout: 240 seconds]
zirman has joined #ocaml
zirman has quit [Changing host]
zirman has joined #ocaml
infinity0 has joined #ocaml
tristero has quit [Quit: WeeChat 1.6]
tristero has joined #ocaml
djellemah_ has joined #ocaml
copy` has joined #ocaml
djellemah has quit [Ping timeout: 256 seconds]
edwin has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
Algebr``` has joined #ocaml
infinity0 has joined #ocaml
raphinou has joined #ocaml
zirman has quit [Remote host closed the connection]
joews has joined #ocaml
Simn has joined #ocaml
<raphinou> he clipboard
noddy has joined #ocaml
<raphinou> I have tried to modify a simple tcp server to use Lwt, but when I run it, it rapidly starts using more and more memory (GBs)
<Algebr```> show code
<raphinou> Anyone having suggestions on the code at http://pastie.org/10983818 ?
<raphinou> No output is produced by the Lwt_io.printf, but CPU usage is high, and memory usage grows
<Algebr```> raphinou: fwiw: val establish_server in https://ocsigen.org/lwt/2.6.0/api/Lwt_io
unbalanced has quit [Ping timeout: 246 seconds]
<raphinou> thx Algebr```! will look at that for sure. But still interested to know what I'm doing wrong :-)
<Algebr```> raphinou: look at its source code for inspiration on how to do it correctly
<raphinou> looking at it :-)
programo has joined #ocaml
zirman has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
trepta7 has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
fraggle_ has quit [Ping timeout: 250 seconds]
FreeBirdLjj has joined #ocaml
fraggle_ has joined #ocaml
ryanartecona has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 246 seconds]
ryanartecona has quit [Client Quit]
<joews> Hey, I'm a newbie. I wanted to implement a list take function (get the first n elements of a list).
<joews> I know I can do it faster imperative style with Array - https://gist.github.com/jwhitfieldseed/40a8f9dd3ec4787b9433710b112c8e82
<joews> But I am sure i'm missing a way to make the recursive version fast
<joews> Any tips?
govg has quit [Quit: leaving]
Muzer has joined #ocaml
d0nn1e has quit [Ping timeout: 256 seconds]
d0nn1e has joined #ocaml
<raphinou> joews: I'm a beginner too, but I think pattern matching is more efficient
fraggle_ has quit [Ping timeout: 260 seconds]
<joews> raphinou: ah... my first implementation did pattern match. I went to if/else because it was more concise. I'll try that way, thanks.
<zozozo> joews: also, List.length runs in linear time, so recomputing it on each call of the inner loop is a bad idea
<octachron> ^ this is the reason why your take function is slow
raphinou has quit [Quit: WeeChat 1.4]
Muzer has quit [Ping timeout: 264 seconds]
fraggle_ has joined #ocaml
<companion_cube> again? I posted a fast version a few days ago
<joews> Thanks
infinity0 has quit [Remote host closed the connection]
<joews> companion_cube: ha - something to do with this? http://adventofcode.com/2016/day/16
<companion_cube> no, I think I pasted a simple implementation for you
<joews> Not me, today is my first time in this channel
<companion_cube> oh!
infinity0 has joined #ocaml
<companion_cube> so that's someone else who came with the same question
<joews> Yeah that's why I wondered about AoC
<joews> You can do part 1 with a really slow take. Part 2 never finishes with my first impl.
<joews> Haha, your impl is what my first try looked like it. I changed it around to experiment with stuff, should have left it alone :-)
<Drup> joews: a few points: don't use tl and hd and don't compare the lenght to 0. Always use pattern matching instead
<companion_cube> hd/tl/length are typical C-like code
<companion_cube> :)
<Drup> (there are no exceptions to that rule :p)
fraggle_ has quit [Ping timeout: 250 seconds]
<joews> hehe got that, thanks :-)
Muzer has joined #ocaml
fraggle_ has joined #ocaml
joews has quit [Ping timeout: 260 seconds]
ocaml579 has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
<ocaml579> My first OCaml program ™
ocaml579 has quit [Quit: Page closed]
joews has joined #ocaml
<joews> ^^ this is me
<Drup> Don't use ==, it's for physical equality. You want to use =
<leah2> you can do pairs with pattern matching too
kakadu has joined #ocaml
jlongster has joined #ocaml
<reynir> Don't use ===, it's silly javascript nonsense :v
<lyxia> let (===) = (=)
f[x] has joined #ocaml
joews has quit [Quit: Page closed]
jlongster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
infinity0 has quit [Ping timeout: 252 seconds]
infinity0 has joined #ocaml
zirman has quit [Remote host closed the connection]
infinity0 has quit [Remote host closed the connection]
zirman has joined #ocaml
infinity0 has joined #ocaml
pyon has quit [Quit: Using Circe, the loveliest of all IRC clients]
lol-icon has joined #ocaml
lol-icon has quit [Client Quit]
lol-icon has joined #ocaml
demonimin has quit [Remote host closed the connection]
maattdd has joined #ocaml
infinity0 has quit [Remote host closed the connection]
fre has joined #ocaml
infinity0 has joined #ocaml
maattdd has quit [Ping timeout: 258 seconds]
demonimin has joined #ocaml
diphuser has quit [Ping timeout: 265 seconds]
octachron has quit [Quit: Leaving]
<jnavila> Hi, all. Does anybody know a bit of building ci with travis-ci?
<jnavila> The opam package seems to build correctly locally, but fails on Travis, with a unbounded Tyxml package.
<companion_cube> did you specify that tyxml is a dependency?
<companion_cube> the travis environment starts afresh
<jnavila> The tyxml is a dependency, it is installed, and it is passed as a -package.
<jnavila> is there a special installation need to access Tyxml.Svg?
<companion_cube> I don't think so
<jnavila> There's a difference though between my installation and Travis' : Travis does not install the latest version of Tyxml.
<jnavila> I just got the script from the ocaml-ci-scripts repo
infinity0 has quit [Remote host closed the connection]
<jnavila> Travis Tyxml_3.1.1, local: Tyxml_4.0.1
<companion_cube> maybe run `opam update` before, in the script
<jnavila> Will try. Thanks
<companion_cube> well it might be a reason, but I'm not sure, really
infinity0 has joined #ocaml
<jnavila> Ah, I can't do that. It's in the script that's downloaded from ocaml-ci-scripts
maattdd has joined #ocaml
<companion_cube> no idea then
tane has quit [Quit: Leaving]
* companion_cube uses jenkins
<jnavila> companion_cube: too easy ;-)
<jnavila> Ah, I think that in the script opam is init to point to a specific repo : opam init -a git://github.com/ocaml/opam-repository --comp=4.04.0
<companion_cube> ah, maybe tyxml is not compatible yet?
unbalanced has joined #ocaml
<Drup> jnavila: you should add a constraint in your opam file, the Tyxml module is tyxml >= 4.0.0
maattdd has quit [Ping timeout: 265 seconds]
<jnavila> Drup: yeah, I just realized. It's too late for tonight. Thanks anyway.
jnavila has quit [Remote host closed the connection]
zirman has quit [Remote host closed the connection]
programo has quit [Ping timeout: 252 seconds]
larhat has quit [Quit: Leaving.]
zirman has joined #ocaml
zirman has joined #ocaml
zirman has quit [Changing host]
zirman has quit [Remote host closed the connection]
Simn has quit [Read error: Connection reset by peer]
zirman has joined #ocaml
tobiasBora has quit [Ping timeout: 248 seconds]
_y has quit [Ping timeout: 260 seconds]
_y has joined #ocaml
Algebr``` has quit [Ping timeout: 258 seconds]
_y has quit [Remote host closed the connection]
_y has joined #ocaml
kakadu has quit [Remote host closed the connection]
tobiasBora has joined #ocaml
wagle has quit [Remote host closed the connection]
wagle has joined #ocaml
tmtwd has joined #ocaml
jao has joined #ocaml
tmtwd has quit [Client Quit]
tobiasBora has quit [Ping timeout: 246 seconds]
tobiasBora has joined #ocaml
_y has quit [Ping timeout: 258 seconds]
michbad__ has quit [Read error: Connection reset by peer]
tobiasBora has quit [Ping timeout: 258 seconds]
argent_smith has quit [Quit: Leaving.]