adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Upcoming OCaml MOOC: https://huit.re/ocamlmooc | OCaml 4.03.0 release notes: http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
axiles has joined #ocaml
manizzle has quit [Remote host closed the connection]
manizzle has joined #ocaml
rand__ has quit [Quit: leaving]
zaquest has quit [Ping timeout: 250 seconds]
brunoro has joined #ocaml
zaquest has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
brunoro has quit [Ping timeout: 268 seconds]
d0nn1e has joined #ocaml
sh0t has quit [Remote host closed the connection]
brunoro has joined #ocaml
axiles has quit [Ping timeout: 268 seconds]
axiles has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
brunoro has joined #ocaml
kevinch has quit [Quit: Computer has gone to sleep.]
nomicflux has quit [Quit: nomicflux]
pierpa has joined #ocaml
brunoro has quit [Ping timeout: 256 seconds]
kevinch has joined #ocaml
brunoro has joined #ocaml
nomicflux has joined #ocaml
mfp has quit [Ping timeout: 256 seconds]
TarVanimelde has joined #ocaml
ygrek has joined #ocaml
Sorella has quit [Quit: Connection closed for inactivity]
brunoro has quit [Ping timeout: 250 seconds]
brunoro has joined #ocaml
hunteriam has quit [Quit: Connection closed for inactivity]
mayathecat has joined #ocaml
nomicflux has quit [Quit: nomicflux]
mayathecat has quit [Remote host closed the connection]
mayathecat has joined #ocaml
wxfdglm has joined #ocaml
mayathecat has quit [Ping timeout: 244 seconds]
kevinch has quit [Quit: Computer has gone to sleep.]
_whitelogger has joined #ocaml
zpe has joined #ocaml
TarVanimelde has quit [Read error: Connection reset by peer]
mayathecat has joined #ocaml
zpe has quit [Ping timeout: 250 seconds]
mayathecat has quit [Remote host closed the connection]
mayathecat has joined #ocaml
nomicflux has joined #ocaml
Algebr has quit [Ping timeout: 268 seconds]
brunoro has quit [Ping timeout: 252 seconds]
nomicflux has quit [Quit: nomicflux]
wxfdglm has quit [Ping timeout: 256 seconds]
brunoro has joined #ocaml
wxfdglm has joined #ocaml
mayathecat has quit [Ping timeout: 260 seconds]
mayathecat has joined #ocaml
shinnya has quit [Ping timeout: 256 seconds]
mayathecat has quit [Remote host closed the connection]
brunoro has quit [Ping timeout: 268 seconds]
manizzle has quit [Ping timeout: 260 seconds]
TarVanimelde has joined #ocaml
TarVanimelde has quit [Client Quit]
brunoro has joined #ocaml
MercurialAlchemi has joined #ocaml
noddy has quit [Ping timeout: 250 seconds]
_whitelogger has joined #ocaml
noddy has joined #ocaml
mayathecat has joined #ocaml
shinnya has joined #ocaml
mayathecat has quit [Remote host closed the connection]
minn has quit [Quit: Leaving]
manizzle has joined #ocaml
slash^ has joined #ocaml
TarVanimelde has joined #ocaml
pierpa has quit [Ping timeout: 260 seconds]
TarVanimelde has quit [Read error: Connection reset by peer]
ygrek has quit [Ping timeout: 250 seconds]
xaimus has quit [Ping timeout: 258 seconds]
teiresias has quit [Read error: Connection reset by peer]
wxfdglm has quit [Ping timeout: 260 seconds]
xaimus has joined #ocaml
axiles has quit [Ping timeout: 256 seconds]
wxfdglm has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 268 seconds]
Onemorenickname has joined #ocaml
axiles has joined #ocaml
wxfdglm has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ocaml
AlexDenisov has joined #ocaml
Onemorenickname_ has joined #ocaml
MercurialAlchemi has joined #ocaml
Onemorenickname has quit [Ping timeout: 252 seconds]
Algebr has joined #ocaml
Sorella has joined #ocaml
wxfdglm has joined #ocaml
Algebr has quit [Ping timeout: 256 seconds]
orbifx has joined #ocaml
Algebr has joined #ocaml
orbifx has quit [Ping timeout: 268 seconds]
nicoo has quit [Remote host closed the connection]
nicoo has joined #ocaml
StatelessCat has joined #ocaml
Simn has joined #ocaml
brunoro has quit [Ping timeout: 265 seconds]
mfp has joined #ocaml
dmi3y has joined #ocaml
rand__ has joined #ocaml
TarVanimelde has joined #ocaml
Algebr has quit [Ping timeout: 244 seconds]
argent_smith has quit [Ping timeout: 260 seconds]
gjaldon has joined #ocaml
jimt_ has quit [Ping timeout: 244 seconds]
dmi3y has quit [Quit: dmi3y]
Onemorenickname_ has quit [Ping timeout: 256 seconds]
Algebr has joined #ocaml
zaquest has quit [Quit: Leaving]
brunoro has joined #ocaml
zaquest has joined #ocaml
dmi3y has joined #ocaml
Onemorenickname_ has joined #ocaml
dmi3y has quit [Quit: dmi3y]
Algebr has quit [Ping timeout: 268 seconds]
gjaldon has quit []
brunoro has quit [Ping timeout: 250 seconds]
jimt has joined #ocaml
fraggle_ has quit [Ping timeout: 250 seconds]
jnavila has joined #ocaml
TarVanimelde has quit [Read error: Connection reset by peer]
argent_smith has joined #ocaml
dmi3y has joined #ocaml
<jnavila> Hi all. Is it only me or Ocaml planet is failing badly?
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 252 seconds]
dmi3y has quit [Quit: dmi3y]
larhat has joined #ocaml
larhat has quit [Client Quit]
Algebr has joined #ocaml
<reynir> a
<reynir> a
<reynir> argh, sorry
dmi3y has joined #ocaml
argent_smith has quit [Quit: Leaving.]
Algebr has quit [Ping timeout: 260 seconds]
orbifx has joined #ocaml
jnavila has quit [Ping timeout: 260 seconds]
Algebr has joined #ocaml
Onemorenickname_ has quit [Quit: Leaving]
Algebr has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 244 seconds]
larhat has joined #ocaml
larhat has quit [Client Quit]
larhat has joined #ocaml
xieyuheng has joined #ocaml
<xieyuheng> one have to write type definition twice?
<xieyuheng> one for .ml one for .mli
<zozozo> usually, yes
dmi3y has quit [Quit: dmi3y]
brunoro has joined #ocaml
<xieyuheng> can one avoid this dup ?
brunoro has quit [Ping timeout: 260 seconds]
brunoro has joined #ocaml
govg has joined #ocaml
orbifx has quit [Quit: WeeChat 1.5]
brunoro has quit [Ping timeout: 244 seconds]
groovy2shoes has quit [Quit: Leaving]
groovy2shoes has joined #ocaml
xieyuheng has quit [Quit: ChatZilla 0.9.92 [Firefox 49.0.2/20161021084537]]
<zozozo> one solution is to put type definitions inside a .ml file, with no corresponding .mli file
<zozozo> I usually do this to define module signature for use in functor types
Sim_n has joined #ocaml
Simn has quit [Ping timeout: 250 seconds]
<Drup> you can also use ppx_import :p
zpe has joined #ocaml
nomicflux has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 252 seconds]
larhat has quit [Quit: Leaving.]
larhat has joined #ocaml
mcspud has quit [Ping timeout: 260 seconds]
argent_smith has joined #ocaml
frefity has quit [Ping timeout: 265 seconds]
mcspud has joined #ocaml
frefity has joined #ocaml
mcspud has quit [Ping timeout: 260 seconds]
blackfry has quit [Ping timeout: 260 seconds]
mcspud has joined #ocaml
frefity has quit [Ping timeout: 256 seconds]
blackfry has joined #ocaml
nickapos has quit [Ping timeout: 250 seconds]
brunoro has joined #ocaml
sh0t has joined #ocaml
frefity has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
nickapos has joined #ocaml
nomicflux has quit [Quit: nomicflux]
zpe has quit [Remote host closed the connection]
jnavila has joined #ocaml
d0nn1e has quit [Ping timeout: 260 seconds]
d0nn1e has joined #ocaml
Algebr has joined #ocaml
tane has joined #ocaml
<tane> howdy
<tane> is 4.04.0 already available through opam?
<tane> here it says no, but I've read different elsewhere
<zozozo> seems like 4.04 is not yet available on opam
jnavila has quit [Ping timeout: 260 seconds]
blackfry has quit [Ping timeout: 260 seconds]
blackfry has joined #ocaml
jnavila has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 268 seconds]
mcspud has quit [Ping timeout: 260 seconds]
mcspud has joined #ocaml
mayathecat has joined #ocaml
wxfdglm has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
mayathecat has quit [Remote host closed the connection]
zpe has quit [Ping timeout: 250 seconds]
wxfdglm has joined #ocaml
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 265 seconds]
zpe has joined #ocaml
noddy has quit [Ping timeout: 256 seconds]
blackfry has quit [Ping timeout: 260 seconds]
blackfry has joined #ocaml
cpdean has joined #ocaml
<cpdean> hey everyone, i'm trying to work through an ocaml mooc ( https://www.fun-mooc.fr/courses/parisdiderot/56002S02/session02 ) and i'm stuck on some pretty basic problems
noddy has joined #ocaml
<cpdean> there's a homework assignment to write a function that checks if two values are "valid", and then you use it to write a function that will search for the correct pair of numbers in a range
<cpdean> this feels like it should be a pretty straight-forward brute force problem but when i write a recursive solution it never returns, and i'm not sure how to debug it...
<cpdean> #trace shows me it evaluates several intermediate values instantly and then it just hangs for a few minutes, then spits out a couple more function evaluations then keeps waiting
<Drup> could you link to the precise exercise and show your current code (use a pastebin) ?
<cpdean> sure yeah
<cpdean> its the "enigma" problem, from week 2, section titled "tuples" https://www.fun-mooc.fr/courses/parisdiderot/56002S02/session02/courseware/W2/W2S1/ will paste code in a sec
nomicflux has joined #ocaml
dmi3y has joined #ocaml
<cpdean> Drup: if you can't access the problem description i can paste that in as well
<Drup> I can access :p
<cpdean> nice!
<cpdean> i don't want to use a while or forloop because i feel like that'd be kind of cheating -- and as i'm following the course a couple weeks late i can see they do things with 'impure' ocaml features later on
<cpdean> so i feel like it wasn't intended to be solved with imperative techniques
dmi3y has quit [Quit: dmi3y]
o77 has joined #ocaml
<Drup> well, you don't really have to enumerate everything
<Drup> for a given grand son age, you only ever have to try the quadruple, and then move on
<o77> hi, I don't understand how the recursive steps are built in http://pastebin.pl/view/1e7f2a0a
<cpdean> Drup: that's true... but in any case shouldn't an answer come back pretty quick? testing on the range (99, 10) should come back pretty fast, it shouldn't be more than 1k comparisons right?
<o77> is there any tool to help "debug" a recursive function step by step?
kevinch has joined #ocaml
<Drup> cpdean: your implementation is quite exponential ...
<cpdean> oh i guess "left" and "right" will contain a lot of dupes...
<Drup> exactly
<cpdean> bummer... i was hoping i could just do this in the most naiive way and have it finish in under 10 seconds
zpe has quit [Remote host closed the connection]
<Drup> the correct implementation is actually simpler/shorter than your version, though ;)
zpe has joined #ocaml
<cpdean> just because an implementation is simple or short, doesn't mean it was easy to get there, Drup
<cpdean> ;)
<Drup> o77: in the toplevel, you can use the #trace directive
kevinch has quit [Quit: Computer has gone to sleep.]
zpe has quit [Ping timeout: 256 seconds]
<cpdean> o77: and if you want more information printed out, rewrite your sublists function with type annotations so that the trace directive prints out the intermediate lists of numbers: https://ocaml.org/learn/tutorials/debug.html
<cpdean> otherwise you're going to get a lot of : sublists --> [[]; [<poly>]; [<poly>]; [<poly>; <poly>]]
<cpdean> Drup: thanks for the advice, i'll try re-writing this and see how it goes
brunoro has joined #ocaml
brunoro has quit [Ping timeout: 260 seconds]
cpdean has quit [Ping timeout: 250 seconds]
wxfdglm_ has joined #ocaml
wxfdglm has quit [Ping timeout: 260 seconds]
Orion3k has quit [Remote host closed the connection]
tormen has joined #ocaml
xieyuheng has joined #ocaml
boxed has joined #ocaml
kevinch has joined #ocaml
<boxed> Can I enumerate a sum type? or make a function that parses a sum type from some input and guarantee that all outputs are present in the parser (ie the reverse of a to string conversion with a case)
brunoro has joined #ocaml
kevinch has quit [Client Quit]
<Drup> ppx_deriving can do that
brunoro has quit [Ping timeout: 256 seconds]
cpdean has joined #ocaml
kevinch has joined #ocaml
jnavila has quit [Ping timeout: 268 seconds]
<o77> Drup: and cpdean: thanks for the tips!
sillyotter has joined #ocaml
<o77> Another question: how to type annotate the input parameter of a `let namefunc = function`? Do I need to convert it to `let namefunc nameparam = match`?
<o77> i.e. `let namefunc (nameparam : type) = match`
<Drup> let namefunc : input -> output = function ...
<o77> the '-> output' type annotation is optional, right?
<Drup> No, but you can use "_" to mean "any type"
jnavila has joined #ocaml
<o77> Thanks once again Drup! It's Sunday (at least in my meridian) you should charge extra charge for the support! :-)
slash^ has quit [Read error: Connection reset by peer]
sillyotter has quit [Quit: WeeChat 1.4]
jnavila has quit [Ping timeout: 250 seconds]
zpe has joined #ocaml
jnavila has joined #ocaml
dmi3y has joined #ocaml
brunoro has joined #ocaml
kamog has joined #ocaml
mayathecat has joined #ocaml
jnavila has quit [Ping timeout: 260 seconds]
boxed has quit [Ping timeout: 260 seconds]
brunoro has quit [Ping timeout: 265 seconds]
jnavila has joined #ocaml
mayathecat has quit [Quit: Mutter: http://www.mutterirc.com]
mayathecat has joined #ocaml
pierpa has joined #ocaml
jnavila has quit [Ping timeout: 250 seconds]
mayathecat has quit [Ping timeout: 250 seconds]
mayathecat has joined #ocaml
kevinch has quit [Quit: Computer has gone to sleep.]
kakadu has joined #ocaml
mayathecat has quit [Remote host closed the connection]
Heasummn has joined #ocaml
wxfdglm_ has quit [Ping timeout: 252 seconds]
xieyuheng has quit [Quit: ChatZilla 0.9.92 [Firefox 49.0.2/20161021084537]]
Heasummn has quit [Read error: Connection reset by peer]
jnavila has joined #ocaml
dmi3y has quit [Quit: dmi3y]
brunoro has joined #ocaml
freusque has joined #ocaml
brunoro has quit [Ping timeout: 250 seconds]
o77 has quit [Quit: Page closed]
mayathecat has joined #ocaml
mayathecat has quit [Remote host closed the connection]
AlexDenisov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
freusque has quit [Quit: WeeChat 1.4]
Algebr has quit [Ping timeout: 250 seconds]
jnavila has quit [Ping timeout: 260 seconds]
Heasummn has joined #ocaml
zaltekk has quit [Ping timeout: 256 seconds]
jnavila has joined #ocaml
jnavila has quit [Ping timeout: 252 seconds]
wolfcore has quit [Read error: Connection reset by peer]
<cpdean> i'm having total writers block trying to figure out how to do a 2 dimensional search without a loop
<cpdean> am i going to have to pass around a bunch of extra state just to keep track of where i am in the search to keep this implementation recursive? that seems so ugly
wolfcore has joined #ocaml
<Drup> cpdean: which exercise is it, this time ?
<Drup> it's not two dimensional
<cpdean> it's not? but you have two scalars you're moving to try to find a solution
brunoro has joined #ocaml
<cpdean> you can cut work out by filtering on one of the predicates
<Drup> except that if you fix one of them, the other one has only one possible value
<Drup> so it's not 2 dimensional :)
<cpdean> but then when you exhaust that side, you move the other right?
<cpdean> do you mean there's some way to solve this one algebraically?
<Drup> no, just try each grand son age linearly (while respecting the conditions)
<cpdean> Drup: and i'd do that recursively?
<Drup> yes
<cpdean> oh i guess you don't have to check the other side because you can just project from the grandson age to what a working gf age is
<Drup> precisely
brunoro has quit [Ping timeout: 244 seconds]
<cpdean> i'm awful at math
<Drup> It's an acquired skill, you'll get better :)
<cpdean> haha
rand__ has quit [Quit: leaving]
MercurialAlchemi has quit [Ping timeout: 256 seconds]
kevinch has joined #ocaml
jnavila has joined #ocaml
<cpdean> hmm... well i've done what i think should work, but when i submit it, it apparently fails on a couple inputs https://gist.github.com/cpdean/af2383855e4ed9ac4020e8db30b7eb91
<cpdean> claims there should be one in (84, 12) and (99, 10) but my impl spits out (-1, -1) for them
jnavila has quit [Client Quit]
<Drup> one line 17, you don't want to test with f, that's just the upper limit. You should test with 4*s directly (since you checked that it's relevant in line 16)
<cpdean> Drup: ah youre right woops
<tobiasBora> Hello,
pFKJBlvJgdLpaoQS has joined #ocaml
pFKJBlvJgdLpaoQS has left #ocaml [#ocaml]
<adrien> if only freenode had some bot-control
argent_smith has quit [Quit: Leaving.]
tane has quit [Quit: Leaving]
brunoro has joined #ocaml
fraggle_ has joined #ocaml
axiles has quit [Ping timeout: 252 seconds]
brunoro has quit [Ping timeout: 256 seconds]
axiles has joined #ocaml
brunoro has joined #ocaml
axiles has quit [Ping timeout: 260 seconds]
Sim_n has quit [Ping timeout: 260 seconds]
Sim_n has joined #ocaml
petroav has joined #ocaml
<petroav> Hi all! Is it possible to browse library source code in Vim using Merlin?
<petroav> I've added "PKG core" to my .melin but when I try to navigate to the definition of the core module Merlin tells me that the corresponding ML file can't be found. Do I have to add the source paths to the Core module to my .merlin?
axiles has joined #ocaml
brunoro has quit [Ping timeout: 244 seconds]
<tobiasBora> Hello,
<petroav> Hmm, but yea reading that wiki page it seems like I need to manually add paths for every module I want to explore
<tobiasBora> I would like to listen on one lwt socket like interface (in fact it's in websocket)
<tobiasBora> from two different places
<tobiasBora> The first one should always listen and answer to "ping" requests using "pong"
<tobiasBora> The second one should be controlled by the user, so that he could receive a packet of type text when he wants
<tobiasBora> What is the good way to proceed ? I could create a new socket, and forward all non ping messages on this socket, but it's quite dirty
shinnya has quit [Ping timeout: 268 seconds]
Sim_n has quit [Quit: Leaving]
<Enjolras> tobiasBora: you could create you own Lwt_io.channel, intercept all the ping and pass the other messages up
brunoro has joined #ocaml
<Enjolras> see Lwt_io.make
kevinch has quit [Quit: Computer has gone to sleep.]
kevinch has joined #ocaml
cpdean has quit [Ping timeout: 250 seconds]
cpdean has joined #ocaml
<tobiasBora> Enjolras: In fact I'm not sure it's that easy, since I don't have access to the channel...
<tobiasBora> The function I get is with_connection from https://github.com/vbmithr/ocaml-websocket/blob/master/lib/websocket_lwt.ml
<tobiasBora> and it returns only a function () -> Frame.t
fluter has quit [Ping timeout: 260 seconds]