adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.02.2 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
<Algebr> Drup: okay, but the stuff from 3.0 probably isn't an extension anymore, but what about GADTs, only introduced in 4.00, are they no longer an extension
<Drup> imho, this notion of extension doesn't make sense anymore, period
<Drup> but I sugest you ask the core team directly (either on mantis or on the mailing list) if you are willing to dedicate the time
<apache2> is it possible to have when-guards only apply to some patterns? example:
<apache2> match x-y with 0 when x=0 | 1 -> (*case 1*) | 0 -> (* case 2*)
<apache2> or do I have to match x , x-y with ...
<dmbaturin> apache2: Sure.
<apache2> what's the syntax for doing so?
<dmbaturin> Or, wait. Let me re-read the question. :)
Algebr has quit [Ping timeout: 244 seconds]
<dmbaturin> Generally, if both x and y are in scope, this should work as is.
<Drup> when are for a whole group of or patterns, iirc
__uu__ has joined #ocaml
<dmbaturin> "let foo x y = match (x-y) with 0 when x = 0 -> 99 | 0 -> 98 | _ -> 97" apparently works as expected (foo 0 0 -> 99, but foo 2 2 -> 98).
<apache2> I think Drup is right
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
__uu___ has joined #ocaml
pw_ has joined #ocaml
__uu____ has joined #ocaml
__uu____ has quit [Remote host closed the connection]
__uu__ has quit [Ping timeout: 260 seconds]
__uu__ has joined #ocaml
__uu___ has quit [Ping timeout: 250 seconds]
pw_ has quit [Ping timeout: 250 seconds]
johnf__ has quit [Read error: Connection reset by peer]
manuel_ has quit [Quit: manuel_]
toomuchtvrotsurb has quit [Remote host closed the connection]
manuel_ has joined #ocaml
pw_ has joined #ocaml
johnf has joined #ocaml
pw_ has quit [Remote host closed the connection]
pw_ has joined #ocaml
ncthom91 has joined #ocaml
ncthom91 has quit [Client Quit]
damason has quit [Quit: No Ping reply in 180 seconds.]
damason has joined #ocaml
ceryo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ncthom91 has joined #ocaml
ncthom91 has quit [Client Quit]
manuel_ has quit [Quit: manuel_]
nullcatxxx_ has joined #ocaml
FreeBirdLjj has joined #ocaml
damason has quit [Ping timeout: 264 seconds]
swgillespie has joined #ocaml
damason has joined #ocaml
nullcatxxx_ has quit [Read error: Connection reset by peer]
nullcatxxx_ has joined #ocaml
swgillespie has quit [Client Quit]
pw_ has left #ocaml ["ERC (IRC client for Emacs 25.0.50.4)"]
psy_ has quit [Ping timeout: 256 seconds]
nullcatxxx_ has quit [Read error: Connection reset by peer]
AlexRussia has quit [Ping timeout: 260 seconds]
nullcatxxx_ has joined #ocaml
<jmasseo> with menhir/whatever, is it possible to make seperated_list allow a trailing seperator?
<jmasseo> like if i had a json array [1,2,3,4,]
<jmasseo> i want that to be legal.
<Drup> add an optional(sep) at the end ?
<jmasseo> 'optional'? there are a few 'option' methods
<Drup> let me consult my menhir documentation
<jmasseo> i'm going to discard the return of it anyway
<Drup> I would say, terminated, in fact
<jmasseo> so seperated_list(COMMA,terminated(value,COMMA))?
<jmasseo> nope
<jmasseo> hmm
<Drup> do you allow the empty list ?
<jmasseo> i need to write my own function to do this.
<jmasseo> empty list does not have a comma though
<Drup> precisely.
<Drup> so, yes, you will have to write it
<jmasseo> well
<Drup> (it's not terribly complicated, luckily)
<jmasseo> trying to learn wtf i'm doing.
<jmasseo> right
<jmasseo> i don't think it will be difficult
mac10688 has quit [Ping timeout: 255 seconds]
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
darkf has joined #ocaml
<jmasseo> fixed it
tmtwd has joined #ocaml
AlexRussia has joined #ocaml
picachu has quit [Ping timeout: 255 seconds]
jeffmo has joined #ocaml
nullcatxxx_ has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
<apache2> is menhir useful (as in "pleasant") to use for struct-like parsing, or does it only make sense if you have an actual grammar?
<Drup> you need to be able to lex
<Drup> (that is, emit a string of token)
<Drup> (whatever tokens actually are)
<Drup> array of bytes are not very lexable, unfortunatly
picachu has joined #ocaml
nullcatxxx_ has quit [Read error: Connection reset by peer]
<apache2> ok :(
<Drup> apache2: there is either cstruct or bitstring for this kind of things
<apache2> yes; I'm using bitstring now, and it's very useful, but the camlp4 depency and the conflict with -safe-strings is a bit unfortunate :(
<apache2> does that work, and is it in opam?
<Drup> it mostly works, it's not in opam
nullcatxxx_ has joined #ocaml
jeffmo has quit [Quit: jeffmo]
<apache2> m ok, thanks
psy_ has joined #ocaml
psy_ has quit [Remote host closed the connection]
nullcatxxx_ has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Read error: Connection reset by peer]
nullcatxxx_ has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
<MercurialAlchemi> Drup: will think on it
<MercurialAlchemi> had actually considered lenses as well...
<MercurialAlchemi> but maybe we can have a toml package and a toml-lenses package for people who want more
__uu___ has joined #ocaml
<Drup> at the simplest level, lenses are not complicated and will not blow your API
<Drup> I would even argue that a lens api would still be smaller than the horror you have currently :p
zpe has quit [Ping timeout: 240 seconds]
__uu__ has quit [Ping timeout: 240 seconds]
nullcatxxx_ has quit [Read error: Connection reset by peer]
IbnFirnas has quit [Ping timeout: 244 seconds]
IbnFirnas has joined #ocaml
antkong has quit [Quit: antkong]
struktured has joined #ocaml
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0_ has joined #ocaml
nullcatxxx_ has joined #ocaml
infinity0_ has quit [Remote host closed the connection]
infinity0 has quit [Ping timeout: 250 seconds]
infinity0 has joined #ocaml
toomuchtvrotsurb has joined #ocaml
infinity0 has quit [Remote host closed the connection]
<MercurialAlchemi> Drup: yeah
<MercurialAlchemi> not happy with it either
tmtwd has quit [Ping timeout: 252 seconds]
infinity0 has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 246 seconds]
struktured has quit [Ping timeout: 272 seconds]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
rgrinberg has quit [Ping timeout: 240 seconds]
toomuchtvrotsurb has quit [Remote host closed the connection]
swgillespie has joined #ocaml
picachu has quit [Quit: Saliendo]
zpe has joined #ocaml
zpe_ has joined #ocaml
Fullma has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
__uu__ has joined #ocaml
__uu___ has quit [Ping timeout: 244 seconds]
AltGr has joined #ocaml
MercurialAlchemi has joined #ocaml
shinnya has quit [Ping timeout: 264 seconds]
antkong has joined #ocaml
struktured has joined #ocaml
zpe has joined #ocaml
zpe_ has quit [Ping timeout: 255 seconds]
gobbledigook has joined #ocaml
rgrinberg has joined #ocaml
<gobbledigook> Hi guys, I'm back with another question
<gobbledigook> so what does this line specifically mean
<gobbledigook> (lhs, rhs)::t ?
<gobbledigook> what is this pattern matching "rules" to?
mort___ has quit [Quit: Leaving.]
rgrinberg has quit [Ping timeout: 240 seconds]
Haudegen has quit [Ping timeout: 260 seconds]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
sh0t has joined #ocaml
<gobbledigook> what does (lhs, rhs)::t mean in this example?
<gobbledigook> like, what does this pattern mean?
<Snark> gobbledigook: well, it means there's a list of pairs
<gobbledigook> what does that mean?
<Snark> lhs and rhs are the parts of the initial pair and t is the rest
<gobbledigook> so for example, in this case: rhs::t
<gobbledigook> and a list was
<gobbledigook> [1;2;3;4;5]
<gobbledigook> rhs = 1
<gobbledigook> and t = [2;3;4;5]
<gobbledigook> but how does (lhs, rhs)::t look visually?
<gobbledigook> sorry, rhs = [1]
Haudegen has joined #ocaml
<Snark> [(1,2);(3,4);(5,6)] gives lhs=1, rhs=2 and t=[(3,4);(5,6)]
<gobbledigook> so [1;2;3;4;5] would fail pattern matching with (lhs, rhs)::t
<pikachuyann> yep
<gobbledigook> thanks
<pikachuyann> it would fail type checking before, too
sh0t has quit [Ping timeout: 250 seconds]
wagle has quit [Ping timeout: 244 seconds]
wagle has joined #ocaml
Guest58751 has quit [Ping timeout: 256 seconds]
ely-se has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
keen______ has joined #ocaml
keen_____ has quit [Ping timeout: 250 seconds]
<struktured> https://github.com/c-cube/ocaml-containers/blob/master/src/core/CCError.mli#L39 < -- what does that + mean in front of the type parameters?
zpe has quit [Remote host closed the connection]
<ely-se> struktured: that t is covariant in 'good and 'bad
<struktured> ely-se: thanks for the link
<ely-se> it means that (a, b) t is a subtype of (c, d) t if a is a subtype of c and b is a subtype of d
zpe has joined #ocaml
<struktured> got it..interesting..thanks
ollehar has joined #ocaml
zpe_ has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
mobius-eng has joined #ocaml
zpe_ has quit [Remote host closed the connection]
struktured has quit [Ping timeout: 260 seconds]
rgrinberg has joined #ocaml
mort___ has joined #ocaml
larhat1 has quit [Quit: Leaving.]
rgrinberg has quit [Ping timeout: 264 seconds]
Muzer has quit [Ping timeout: 240 seconds]
Muzer has joined #ocaml
ely-se has quit [Quit: leaving]
ely-se has joined #ocaml
theblatt1 is now known as theblatte
amnn has joined #ocaml
AltGr has left #ocaml [#ocaml]
amnn has quit [Ping timeout: 252 seconds]
toolslive has joined #ocaml
__uu__ has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
Kakadu has joined #ocaml
rgrinberg has quit [Ping timeout: 272 seconds]
tibor_ has joined #ocaml
zpe has joined #ocaml
_andre has joined #ocaml
Lapinot has joined #ocaml
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
FreeBird_ has quit [Ping timeout: 244 seconds]
zpe has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
rgrinberg has quit [Ping timeout: 260 seconds]
Haudegen has quit [Ping timeout: 268 seconds]
Haudegen has joined #ocaml
amnn has joined #ocaml
<Lapinot> hi there
<Lapinot> anyone fluent with the ocamlbuild system?
manuel_ has joined #ocaml
ceryo has joined #ocaml
rand__ has joined #ocaml
<companion_cube> ask anyway?
<reynir> Yes, there are usually people in this channel who know ocamlbuild well
<Lapinot> hi!
<Lapinot> yes so i am using jocaml, so i have the -use-jocaml switch, but when i include a package with -pkg, i get an "both define a module named ..." error
<companion_cube> named what?
<Lapinot> i think that jocaml is not a lot developped anymore so this may be a strange error... I think it comes from the fiddling that the jocaml guys did in the ocaml source
<Lapinot> i have this pb with the Unix module
<companion_cube> can you try compiling a trivial program with -use-jocaml?
<companion_cube> oh, Unix
ely-se has quit [Quit: leaving]
<Lapinot> i have a small file to reproduce the error
<companion_cube> oh btw there's an opam switch with JOCaml
<Lapinot> yeah i tried that some times ago, but i could manage to install packages with jocaml (some dont compile with jocaml, i have to compile them with the companion ocaml)
<companion_cube> hmm :/
<Lapinot> is there a "-I path/to/foo" command that could substitute a "-pkg foo" command in ocamlbuild
<Lapinot> i tried "-I lib/ocaml/site-lib/foo" but it doesnt include
mort___ has quit [Ping timeout: 246 seconds]
<companion_cube> -cflags -I,+path/to/foo?
<companion_cube> (not sure)
<Lapinot> hmm nope, i dont get it to work.. actually do i have to include a directory or the actual .cmxa file?
mobius-eng has quit [Ping timeout: 264 seconds]
<companion_cube> maybe... :/
<Lapinot> when i compile with "ocamlbuild -use-jocaml -pkg cryptokit a.native" (yeah its cryptokit that i need ><) the command exectuted by ocamlbuild (which fails) is "jocamlopt -I /prefix/lib/ocaml -I /prefix/lib/ocaml/site-lib/cryptokit -I /prefix/lib/ocaml/site-lib/num/prefix/lib/ocaml/unix.cmxa /prefix/lib/ocaml/nums.cmxa /prefix/lib/ocaml/site-lib/cryptokit/cryptokit.cmxa a.cmx -o a.native"
<companion_cube> this looks good to me, so I really don't know, sorr
<companion_cube> y
<Lapinot> hmm ok thanks anyway! I am going to ask it on stackoverflow and explain a bit more
<companion_cube> good luck
<Lapinot> :)
ggole has joined #ocaml
mobius-eng has joined #ocaml
freehck has joined #ocaml
zpe has joined #ocaml
ely-se has joined #ocaml
gobbledigook has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
gobbledigook has joined #ocaml
zpe has quit [Ping timeout: 256 seconds]
Simn has joined #ocaml
gobbledigook has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mort___ has joined #ocaml
<toolslive> what about using ocamlbuild with ocamlfind: ocamlbuild -use-ocamlfind .... and have the _tags file with something like true: package(snappy)
<toolslive> that should do the trick for any package installed through opam
<Lapinot> actually i tried it and the -use-ocamlfind flag is not exactly the best friend of the -use-jocaml flag: it overrides it and the whole things are compiles with ocaml compilers instead of jocaml compilers
rgrinberg has joined #ocaml
BitPuffin has joined #ocaml
zpe has joined #ocaml
<toolslive> you can look at the _build/_log file and try to massage the inputs to get the desired output (that's what I do when I get into link errors)
<toolslive> I typically nick the link/compile command, paste it in a script, and start to edit until it works, then I reverse engineer the changes into myocamlbuild.ml
<toolslive> If anybody knows a better strategy, please share ;)
xet7_ has joined #ocaml
<Lapinot> as you can see a did the 'edit until it works' step but i dont know how to do something with the myocamlbuild.ml file
FreeBirdLjj has joined #ocaml
amnn has joined #ocaml
<toolslive> you can edit the 4.02.3/lib/findlib.conf file to get the correct compiler
<toolslive> don't know if that helps
<Lapinot> aha i will try that
<toolslive> but that's with -use-ocamlfind again....
<Lapinot> yep
<toolslive> ocamlfind printconf will show you where to find stuff
zpe has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
<jmasseo> so my menhir thing last night(i had to run), to get it to allow a trailing separator, i copy/pasted the separated_list/separated_nonempty_list and make the call from separated_nonempty_list call back to separated_list, so in the event of an excess separator, it just returns an empty list.
<jmasseo> i imagine that dramatically changes the stack behaviour.
<jmasseo> i can probably optimize that
<Lapinot> toolslive: i got findlib to select the right compiler, and now its slightly better, but it keeps including unix.cmxa so there is still the clash
manuel_ has quit [Quit: manuel_]
<Lapinot> toolslive: ugly hack: it works when i delete "unix" from the requires field of crptokit's META file...
ely-se has quit [Quit: leaving]
FreeBirdLjj has quit [Remote host closed the connection]
<seliopou> finally realized what jsoo stands for :/
<companion_cube> :D
<seliopou> that took way too long
<Drup> seliopou: what did you though it was ? :D
<seliopou> i duno like some subpackage of js_of_ocaml
<seliopou> but then last night i was like... ohhhhhh
<jmasseo> so i copied the separated_list stuff out of menhir std and modified it as such:
<jmasseo> This is no longer tail recursive, correct?
<jmasseo> even if i changed the nonempty call back to calling itself and put an loption in there, i would still lose tail-recursion, correct?
MercurialAlchemi has quit [Read error: Connection reset by peer]
octachron has joined #ocaml
tautologico has joined #ocaml
mort___ has quit [Quit: Leaving.]
moei has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
Bluddy has quit [Quit: Connection closed for inactivity]
sepp2k has joined #ocaml
ely-se has joined #ocaml
manuel_ has joined #ocaml
manuel_ has quit [Client Quit]
manuel_ has joined #ocaml
mort___ has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
amnn has quit [Ping timeout: 240 seconds]
mobius-eng has quit [Ping timeout: 272 seconds]
psy_ has joined #ocaml
marsam has joined #ocaml
jwatzman|work has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
ely-se has quit [Quit: leaving]
bjorkintosh has quit [Ping timeout: 252 seconds]
MercurialAlchemi has joined #ocaml
ely-se has joined #ocaml
tnguyen has joined #ocaml
Mercuria1Alchemi has joined #ocaml
marsam has quit [Remote host closed the connection]
marsam has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
MercurialAlchemi has joined #ocaml
taigi100 has joined #ocaml
<taigi100> hey
<companion_cube> ho
<taigi100> I'm trying to implement List.combine but I have some troubles, how do I add 2 values to a pair of lists?
toomuchtvrotsurb has joined #ocaml
<companion_cube> let (l1,l2) = the_pair in x::l1, y::l2
<taigi100> I see what you say but I'm not sure how to pass that as the second arg
<taigi100> like ... I have a pair followed by a list , how do I add the elements of that pair to the lists in rez
<companion_cube> you need to pattern match on rez
<companion_cube> or use (h1 :: fst rez, h2 :: snd rez)
<companion_cube> which is basically the same
<taigi100> oh
<taigi100> ok :)
toomuchtvrotsurb has quit [Ping timeout: 240 seconds]
<Lapinot> (isn't it "[] -> rez" more than "[] -> 0" that you meant to write? else your function is always returning 0...)
<taigi100> yep changed that and it works
<taigi100> can I use it like fst parc t1 ?
<taigi100> and make it add them when it returns so they get added in the right order?
slash^ has joined #ocaml
ely-se has quit [Quit: leaving]
inr_ is now known as inr
<ggole> Isn't that split rather than combine?
<taigi100> yep it's split
<taigi100> implemented both
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
ollehar has quit [Ping timeout: 272 seconds]
mort___ has quit [Quit: Leaving.]
struk|work has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
mobius-eng has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
jgjl has joined #ocaml
MercurialAlchemi has joined #ocaml
mort___ has joined #ocaml
rgrinberg has quit [Read error: Connection reset by peer]
ollehar has joined #ocaml
rom1504 has joined #ocaml
toomuchtvrotsurb has joined #ocaml
jeffmo has quit [Quit: jeffmo]
jeffmo has joined #ocaml
<struk|work> doh, what happened about blas/lapack's website? http://www.netlib.org/ that work for anybody?
amnn has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
<struk|work> (trying to compile it from source for some ocaml packages which need it)
Bluddy has joined #ocaml
nullcatxxx_ has joined #ocaml
<jmasseo> string_of_float is deprecated?
^elyse^ has joined #ocaml
<octachron> companion_cube, in your containers library, CCRandom.split_list does not yield an uniform distribution. Is that deliberate?
<companion_cube> it's not deliberate
<companion_cube> did you find a skewed distribution?
<companion_cube> I'm really no expert in this kind of things
<octachron> as far as I can see, the distribution is skewed in a quite complex way. Would you mind a pull request to fix that?
<companion_cube> no I wouldn't. But I'd like very much to have insight in why it's skewed!
<companion_cube> how did you discover that?
<octachron> Essentially, looking at the source code.
<octachron> The way the current implementation splits the integer to be summed does not really account for any combinatoric factor
jeffmo has quit [Read error: Connection reset by peer]
<companion_cube> oh ok. Do you think in would be uniform in, say, rational numbers? or is it not related to integers beeing discrete?
<companion_cube> anyway I'm willing to accept a PR fixing that
<octachron> it is not really related, to discretness of integer. In fact the classical algorithm for sampling on the d-simplex is more the same between integer and real.
Kakadu has quit [Quit: Page closed]
<octachron> see https://gist.github.com/Octachron/e9d81d39551dc36f3083 for a comparison between the standard algorithm and split_list
<struk|work> I thought a result like type was introduced into the ocaml std lib? is this true? if so what version hasit?
<companion_cube> struk|work: in the next version
BitPuffin has quit [Ping timeout: 255 seconds]
<struk|work> companion_cube: trying to find the relevant commit on github..
<companion_cube> look at the pull request, will be easier
<struk|work> octachron: man that brings me back to my combinatorial optimization studies. I remember the prof described it as "if you have a hammer, treat everything as a nail"
MercurialAlchemi has quit [Read error: Connection reset by peer]
<struk|work> companion_cube: thanks for the tip. found it https://github.com/ocaml/ocaml/pull/147
ceryo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
MercurialAlchemi has joined #ocaml
<struk|work> companion_cube: so I noticed you went with a sub-typable version, while minsky went with (unsurprisingly) with the jane street version, pure variant, version
darkf has quit [Quit: Leaving]
<struk|work> not sure which I even prefer really
mobius-eng has quit [Ping timeout: 240 seconds]
<struk|work> interesting thread about that very topic in the PR at least
<companion_cube> struk|work: you mean I used a polymorphic variant? yeah
<companion_cube> it was to avoid using an authoritative type
<struk|work> got it
<companion_cube> but I'll provide a module for the new result type
<struk|work> in other news, I see you factored out containers.misc :)
rgrinberg has quit [Ping timeout: 244 seconds]
<struk|work> maybe I should just steal your hashset impl as its the only one I need
<companion_cube> feel free to
shinnya has joined #ocaml
<companion_cube> or you can git submodule the containers-misc repo
<struk|work> git submodule? is that a thing?
xificurC_ has joined #ocaml
<struk|work> https://git-scm.com/docs/git-submodule well I be damned, this could be useful at my company as we have holy wars about a single repo vs many little repos
xificurC has quit [Remote host closed the connection]
lopex has quit [Ping timeout: 240 seconds]
oldmanistan_ has quit [Ping timeout: 240 seconds]
Ravana has quit [Ping timeout: 240 seconds]
NhanH has quit [Ping timeout: 240 seconds]
tg has quit [Quit: Reconnecting]
flx has quit [Remote host closed the connection]
flxx has joined #ocaml
ggherdov has quit [Ping timeout: 240 seconds]
oldmanistan_ has joined #ocaml
xaimus has quit [Ping timeout: 240 seconds]
bjorkintosh has joined #ocaml
lopex has joined #ocaml
seako has quit [Ping timeout: 240 seconds]
xaimus has joined #ocaml
Ravana has joined #ocaml
bobpoekert has quit [Ping timeout: 240 seconds]
NhanH has joined #ocaml
NhanH has joined #ocaml
NhanH has quit [Changing host]
tg has joined #ocaml
bobpoekert has joined #ocaml
apache2_ has joined #ocaml
seako has joined #ocaml
Cypi_ has joined #ocaml
Cypi has quit [Ping timeout: 240 seconds]
apache2 has quit [Remote host closed the connection]
stux|RC-only has quit [Ping timeout: 240 seconds]
nzyuzin has quit [Ping timeout: 240 seconds]
jeffmo has joined #ocaml
nzyuzin has joined #ocaml
manuel_ has quit [Ping timeout: 240 seconds]
stephe has quit [Ping timeout: 240 seconds]
stephe has joined #ocaml
stux|RC-only has joined #ocaml
johnf has quit [Read error: Connection reset by peer]
manuel_ has joined #ocaml
<companion_cube> struk|work: careful, submodule has some shortcomings
<companion_cube> be aware of them
manuel_ has quit [Client Quit]
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ggherdov has joined #ocaml
Guest38 has joined #ocaml
rgrinberg has joined #ocaml
jgjl has quit [Quit: Textual IRC Client: www.textualapp.com]
<flux> oh no! no commit activity in ocaml-multicore since the 1st of Oct!
<flux> maybe if I refresh the page a bit more.. :)
<Lapinot> haha
<flux> I wonder if ffmpeg would be something that could be built decent ocaml bindings without a huge effort..
octachron has quit [Quit: Leaving]
t4nk397 has joined #ocaml
<t4nk397> hello! I have a little question regarding the BatteriesIncluded package - it's Enum.t. is there a way to get the number of already consumed items? Something similiar to the Stream.count
<t4nk397> it seems that Enum.count returns the number of the remaining items :(
<flux> I guess if you can't see it, it doesn't exist
<flux> maybe it could be added :)
<struk|work> companion_cube: yeah I am just studying it for now, prob won't use it for my projects yet
ygrek has joined #ocaml
<t4nk397> flux: should be awesome to have, though :) also, it's mentioned as a "new" Stream...
<t4nk397> flux: I want to use Enum from the string inside my tokenizer and I don't want to have the current position moving everywhere :(
MercurialAlchemi has quit [Read error: Connection reset by peer]
<t4nk397> e.g. I should have position-moving-code in each function I'd pass to the take_while, etc.
MercurialAlchemi has joined #ocaml
taigi100 has quit [Ping timeout: 246 seconds]
<t4nk397> hm, are batteries updated at all :) as the latest release is dated by 2014
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nullcatxxx_ has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
ollehar has quit [Ping timeout: 256 seconds]
<struk|work> I avoid batteries like the plague..but that's just me
MercurialAlchemi has joined #ocaml
t4nk397 has quit [Ping timeout: 246 seconds]
larhat1 has joined #ocaml
ygrek has quit [Remote host closed the connection]
swgillespie has joined #ocaml
ygrek has joined #ocaml
mobius-eng has joined #ocaml
<toolslive> no. I avoid it too, (and I try to stay away from core too)
<toolslive> kitchen sink type libraries that have developed their own eco-system
palomer has joined #ocaml
<palomer> hey guys
<Mercuria1Alchemi> "standard libraries" replacements are kitchen sinks by definition
<palomer> if I include the expression (fun x -> 5) into my code, I don’t get a warning that x is unused
<Mercuria1Alchemi> just depends on how big the sink is
<palomer> is there a way to unable such a warning?
toomucht_ has joined #ocaml
toomuchtvrotsurb has quit [Read error: Connection reset by peer]
<palomer> enable :P
<companion_cube> -w +a
<companion_cube> :P
jwatzman|work has quit [Ping timeout: 246 seconds]
<palomer> cool
<palomer> do you know how to add them to my _tags ?
<companion_cube> the actual warning is listed in `man ocamlc` btw
<companion_cube> true: warn(+a)
<palomer> I’ll just do -w +a
<palomer> I like warnings
<companion_cube> I have +a -44 -4 I think
jwatzman|work has joined #ocaml
ollehar has joined #ocaml
marsam has quit [Remote host closed the connection]
<companion_cube> Mercuria1Alchemi: it's sad that you think that
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Mercuria1Alchemi> companion_cube: why?
<companion_cube> some stdlib extensions are awesome ;)
<Mercuria1Alchemi> well, that's not an indictment
<Mercuria1Alchemi> it's just that if you're building a standard library, it's not specialized
<struk|work> Mercuria1Alchemi: you must be familiar with this then :) http://seb.mondet.org/software/nonstd/index.html
<companion_cube> seems pretty minimal indeed
<Mercuria1Alchemi> well...
<Mercuria1Alchemi> I'm not sure "minimal" is really a desirable target
<Mercuria1Alchemi> for this kind of thing
<struk|work> sure, but I appreciate the acknowlegement that std libraries are nearly misnamed
<Mercuria1Alchemi> it's a bit like these linux WMs "we are below X lines of code"
<Mercuria1Alchemi> I don't really agree with the "standard libraries are an obsolete concept"
ggole has quit []
<toolslive> the fun ends when you need to functorize your code to be able to work with both Core.async and Lwt
<Mercuria1Alchemi> next thing you know, you open your favorite REPL in a language bulit by somebody who took that seriously, and you find out you can't open a bloody file
<Mercuria1Alchemi> then you want to build a library, and you have 6 different hashmap implementations to choose from, so you resort to functorizing the world
<Mercuria1Alchemi> oh wait, that's ocaml
<companion_cube> well you can open a file in OCaml
<Mercuria1Alchemi> yeah, but it's because the default stdlib is a kitchen sink :)
<Mercuria1Alchemi> just a broken sink with a leaky faucet
<companion_cube> well, some parts should die, but some others are decent
<Mercuria1Alchemi> yeah, but if they were sufficient, nobody would write standard library extensions
<companion_cube> sure they would, people in OCaml love to reinvent things that work
<companion_cube> trust me on this ;)
<struk|work> toolslive: re: functorize over lwt/async ...yep I'm doing that
<Mercuria1Alchemi> up to a point
<toolslive> yes, I failed to finish
<Mercuria1Alchemi> if you look around, you often see bits of stdlib of other languages being rewritten and sometimes making it into the actual stdlib
<Mercuria1Alchemi> but absolutely not to the same extent as ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
eni has joined #ocaml
<toolslive> the Java strategy was great: take the best library for X as a template for the X interface and let people plug in their on implementations (like java mail, java security, ...)
<companion_cube> I'd like OCaml maintainers to accept contributions to stdlib a lot
<toolslive> well, if you accept things you accept ownership and maintenance....
<flux> but they have a point. once something goes in, they're stuck maintaining it forever. and ever.
<flux> oh, whathesaid :)
<struk|work> toolslive: eh java didn't actually do it right either. take google gauve's functional api for instance, which was completely rewritten in java8
<companion_cube> but how difficult is it to maintain Option.>>= ?
<companion_cube> or basic f unctions over List, Array, etc.
<struk|work> not to mention the shittiness of java generics preventing a map.get(...) operation from being type checked.
<flux> I guess it'd be reasonable to have the modules that are there be 'fully functional'
<flux> but, then you want more things.. :)
<toolslive> yes, I once suggested an improvement for the java std lib and it never made it. while it was 100% compatible and a serious performance improvement and shorter.
<toolslive> 0 feedback too.
<toolslive> (and that was before 2000)
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<companion_cube> flux: yeah, I'd like an Option module
<companion_cube> and more feature-complete List, Array, ...
<companion_cube> which is why I wrote containers actually
<flux> but why can't an "ocaml distribution" do that
<toolslive> also, insights change..... the attitude towards mutability in OCaml is different now compared to 2000.
<toolslive> attitude towards the multitude of cpu cores too (but slowly) ;)
<Mercuria1Alchemi> flux: what would be the advantage of an "ocaml distribution"?
<Mercuria1Alchemi> apart from a faster release cycle
<apache2_> String.index_from "a" 0 'a' == exn Not_found
<flux> well, actually there are 'almost' ocaml distributions like ocamlbrew
<apache2_> sorry no that's 0
<apache2_> String.index_from "a" 1 'a' == exn Not_found
<flux> but the benefit would be less load on the ocaml compiler team..
<companion_cube> eww
<reynir> struk|work: Why is it Map.get is like that?
<flux> maybe more likely to actually happen.. :)
<apache2_> String.index_from "a" 2 'a' == Invalid_argument "String.index_from / Bytes.index_from"
<apache2_> how come the errors are different?
<companion_cube> you mean the text of the error?
<apache2_> yes
<apache2_> well Not_found and Invalid_argument
<apache2_> the doc says: Raise Invalid_argument if i is not a valid position in s. Raise Not_found if c does not occur in s after position i.
<companion_cube> I guess 1 designs a "valid" position in the string, if you see it as a position between chars
<apache2_> why is 1 a valid position in the string?
<companion_cube> but I agree, it's strange
<apache2_> I tried matching against char_of_int 0 .. 255, no matches
palomer_ has joined #ocaml
<Mercuria1Alchemi> flux: well... I think that's something where the community could be involved in
palomer has quit [Ping timeout: 244 seconds]
palomer_ is now known as palomer
<apache2_> for i = 0 to 255 do try Printf.printf "\n%d,%d\n" i @@ String.index_from "a" 1 (char_of_int i) with Not_found -> () done;;
<Mercuria1Alchemi> you don't need to be a compiler guru to maintain an option lib
palomer has quit [Client Quit]
palomer has joined #ocaml
<toolslive> yes, also, the stdlib has useless duplication in some areas, while it lacks consistency in others....
<reynir> apache2_: should String.index_from "" 0 'a' raise Invalid_argument too?
<companion_cube> pff, maybe it would be possible to ship the compiler with a "stdlib" that only contains some type definitions
<toolslive> what you actually need is a tool that rewrites the real world code, whenever the language improves.
taigi100 has joined #ocaml
_andre has quit [Quit: leaving]
<companion_cube> and the stdlib itself, built upon those types, would be provided by the community
<toolslive> a sort of python2to3 that works ;)
<apache2_> reynir: yes?
<apache2_> reynir: looking for letters in a string that can't contain them is obviously an error
<reynir> apache2_: what about String.index "" 'a' ?
<apache2_> like allocating an array with two elements and requesting the third
<toolslive> well, these days people tend to prefere None iso Not_found
jeffmo has quit [Quit: jeffmo]
<apache2_> yeah, I think exceptions should die, but this is a bit weird :)
<taigi100> hey guys , I need to multiply each element in a list x times, for example if I call func [1;2;3] 3;; it should return [1;1;1;2;2;2;3;3;3];;. What I've tried was something like : http://paste.isomorphis.me/wmT. I'm not sure how to make it return 'rez' ( If I add in rez at the end it sais it's unbounded ).
<companion_cube> apache2_: no, exceptions are quite useful
<apache2_> taigi100: List.fold_right (fun e -> fun acc -> e::e::e::acc) [1;2;3] [];;
marsam has joined #ocaml
<apache2_> taigi100: iter returns unit, so you can't use that. you can use List.map and end up with [[1;1;1] ; [2;2;2] ; [3;3;3]] which you can then flatten.
<apache2_> companion_cube: they're dangerous :(
<apache2_> the compiler should have a way of making you handle them
slash^ has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
<taigi100> and How should I go about using .map ?
<taigi100> I mean the function inside
<apache2_> I think you should use List.fold_right in this case
<taigi100> how?
<apache2_> List.flatten (List.map (fun e -> [e ; e ; e]) [1;2;3]);;
<apache2_> like I wrote above?
<taigi100> It's not 3 always
<taigi100> It's a param that get's passed in, I gave 3 like an example
<apache2_> ah
<taigi100> but building a list of lists sounds like an idea ( like you did with the map
<apache2_> let n = 4 in List.fold_right (fun e -> fun acc -> let rec xxx acc = function 0 -> acc | i -> xxx (e::acc) (i-1) in xxx acc n) [1;2;3] [];;
<apache2_> one approach
<taigi100> yep
<taigi100> gotta get used to using fold_riight
<taigi100> xD
<apache2_> cheers :)
ocaml413 has joined #ocaml
<taigi100> thnx :P
<ocaml413> hello! is there a way to implicitly open a module for all my files?
<taigi100> also , know any good tutorials/explanations for sets/types ?
<ocaml413> (i'm using oasis if it's important)
<taigi100> I think you can use open Module in the Ocaml consolo
<taigi100> console*
obadz has quit [Ping timeout: 256 seconds]
<ocaml413> taigi100: what console are you talking about? as I'm compiling my stuff ;)
<taigi100> idk xD new to ocaml
<taigi100> just write open Module;; in the file
<taigi100> works for me
<reynir> ocaml413: A very ugly way would be to use a preprocessor that inserts "open MyModule" in every file
<taigi100> couldn't you make a custom module that opens modules ? xD
<ocaml413> taigi100: I wanted to skip the manul part :)
<ocaml413> reynir: oh, it's so ugly, so I'll be the preprocessor myself :(
<taigi100> well make a program that opens every file and writes it for you :P
<reynir> ocaml413: heh sorry :)
<flux> ocaml413, note that if you want to open multiple files, you can stick includes and module aliases in your Common module
<flux> (files=modules of course)
palomer has quit [Quit: palomer]
<ocaml413> flux: oh, it will simplify the job, thanks!
<ocaml413> I wonder - do I need to include open-s in both .ml and .mli?
<ocaml413> it complains if I'm not opening in .mli, but I'm checking the Ocaml sources and mli's don't contain any opens
<flux> well, yes
<flux> but usually people may use fully qualified names in .mlis
<flux> and in fact opens are not very popular
<flux> it can make it a bit difficult to see where symbols come from
<flux> module aliases are nicer in that regard
<flux> merlin makes it easier nowadays to find where a symbol comes from, though, but you're still reading the code with your eyes.. :)
<ocaml413> flux: merlin is awesome, indeed! I'm using the Batteries, so it's a bit tedious to write Batteries.Enum.next everywhere, though, I open Batteries
<flux> ocaml413, I think people think it's ok when you have one great library used everywhere
<flux> it gets more annoying when you have five opens at the top of the file :)
rgrinberg has quit [Ping timeout: 265 seconds]
<ocaml413> flux: I see, I won't open other modules :)
<ollehar> best datastructure to handle list of allocations in mark-sweep gc? linked list, stack, ...? that is, how to organize the heap.
obadz has joined #ocaml
ocaml413 has quit [Ping timeout: 246 seconds]
demonimin has quit [Remote host closed the connection]
eni has quit [Quit: Leaving]
demonimin has joined #ocaml
jbrown has quit [Quit: Client exiting]
taigi100 has quit [Ping timeout: 246 seconds]
jbrown has joined #ocaml
<struk|work> reynir: map is pre generics, so its sig is this: public V get(Object o) rather than public V get(K k)
<struk|work> they could make the value typed because covariant return types work in java, but the method parameter change would break compliation of older code
jeffmo has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
canhtak has joined #ocaml
<companion_cube> I wonder whether Go will eventually add generics
marsam has quit [Remote host closed the connection]
freehck has quit [Ping timeout: 246 seconds]
lobo has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
<tibor_> Hi
<tibor_> How can I write a mach "| Some VType nf ->"?
<tibor_> How can I write a match "| Some VType nf ->"?
swgillespie has joined #ocaml
swgillespie has quit [Client Quit]
ncthom91 has joined #ocaml
demonimin has quit [Remote host closed the connection]
ncthom91 has quit [Quit: Textual IRC Client: www.textualapp.com]
demonimin has joined #ocaml
<ollehar> tibor_: missing paranthesis?
swgillespie has joined #ocaml
swgillespie has quit [Client Quit]
Mercuria1Alchemi has quit [Ping timeout: 260 seconds]
swgillespie has joined #ocaml
antkong has quit [Quit: antkong]
amnn has joined #ocaml
antkong has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
rand__ has quit [Ping timeout: 255 seconds]
antkong has quit [Client Quit]
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
amnn has quit [Remote host closed the connection]
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
<jmasseo> I think Core is causing me a lot of type nightmares. As a newb, should I avoid the alternative stdlibs?
amnn has joined #ocaml
<struk|work> jmasseo: I don't think so. can you elaborate on your type nightmares?
amnn has quit [Read error: Connection reset by peer]
<struk|work> maybe they are just slightly unpleasant daydreams?
<jmasseo> it's possible.
amnn has joined #ocaml
<jmasseo> so i'm trying to derive a real world application from the example parser in Real World Ocaml.
<jmasseo> well, 'real world', i'm trying to futz with it.
amnn has quit [Read error: Connection reset by peer]
<jmasseo> but because of it's polymorphic types, i find it hard to use with literally anything else.
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
<struk|work> ok, well a parser is very specific to whateveris being parsed..
<struk|work> maybe you should work with something a tad ismplre
<struk|work> *simpler
mac10688 has joined #ocaml
<jmasseo> the parser isn't the deal, it parses fine. I"m trying to extract the data from the magical data structure it creates.
amnn has joined #ocaml
<companion_cube> yay, I have a brand-new persistent hashtbl
<companion_cube> and it rocks
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
<zozozo> companion_cube: in containers ?
<zozozo> and rocks as in good performances ?
amnn has joined #ocaml
<companion_cube> yep
<companion_cube> and yep
<zozozo> :o
<zozozo> do you have some benchmarks for us to look at ?
<companion_cube> sure, in the master branch, compile benchmarks, then ./run_benchs.native -p tbl_persistent
<companion_cube> to compare with previous version
amnn has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
<companion_cube> or ./run_benchs.native -p tbl to run the table related benchmarks
<companion_cube> basically I've rebuilt the standard hashtbl on top of a persistent array
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
rgrinberg has quit [Ping timeout: 250 seconds]
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
amnn has joined #ocaml
amnn has quit [Read error: Connection reset by peer]
eagleflo has joined #ocaml
amnn has joined #ocaml
canhtak has quit [Quit: canhtak]
cdidd has quit [Ping timeout: 260 seconds]
lobo has quit [Quit: leaving]
sepp2k has quit [Quit: Leaving.]
cdidd has joined #ocaml
ygrek has quit [Ping timeout: 252 seconds]
rand__ has joined #ocaml
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
swgillespie has joined #ocaml
^elyse^ has quit [Quit: Leaving]
jbrown has quit [Remote host closed the connection]
jeffmo has quit [Quit: jeffmo]
jbrown has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
marsam has joined #ocaml
MercurialAlchemi has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
<companion_cube> and now the parser combinators are better :p
MercurialAlchemi has joined #ocaml
<Drup> jmasseo: I'm not sure I got what the issue was
jeffmo has joined #ocaml
rand__ has quit [Ping timeout: 260 seconds]
antkong has joined #ocaml
zol has quit [Quit: WeeChat 0.4.2]
ygrek has joined #ocaml
rand__ has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
mobius-eng has quit [Ping timeout: 268 seconds]
<jmasseo> Drup: my lack of understanding I think. I got pulled to another task so I'll ask for assistance again later.
Kakadu has quit [Remote host closed the connection]
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
toomucht_ has quit [Remote host closed the connection]
toomuchtvrotsurb has joined #ocaml
Haudegen has quit [Ping timeout: 244 seconds]
ceryo has joined #ocaml
jeffmo has quit [Quit: jeffmo]
shinnya has quit [Ping timeout: 246 seconds]
ollehar has quit [Quit: ollehar]
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Client Quit]
Haudegen has joined #ocaml
amnn has quit [Ping timeout: 265 seconds]
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
nullcatxxx_ has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml
ceryo has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rand__ has quit [Quit: leaving]
rgrinberg has joined #ocaml
marsam has quit [Remote host closed the connection]
swgillespie has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rgrinberg has quit [Ping timeout: 272 seconds]
toolslive has quit [Ping timeout: 256 seconds]
<jmasseo> the type system is powerful and unforgiving, providing an unyielding surface for my softened-by-python body to break upon.
toomuchtvrotsurb has quit [Remote host closed the connection]
Lapinot has quit [Ping timeout: 246 seconds]
toomuchtvrotsurb has joined #ocaml
madroach has quit [Ping timeout: 260 seconds]
<Drup> Alternatively, and to piggy back your metaphore, it's something you can safely lean on :p
madroach has joined #ocaml
nullcatxxx_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
MercurialAlchemi has quit [Read error: Connection reset by peer]
<jmasseo> True enough. :)
MercurialAlchemi has joined #ocaml
nullcatxxx_ has joined #ocaml
swgillespie has joined #ocaml
xaimus has quit [Quit: leaving]
Simn has quit [Quit: Leaving]
xaimus has joined #ocaml
MercurialAlchemi has quit [Read error: Connection reset by peer]
MercurialAlchemi has joined #ocaml