companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.05.0 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.05/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
nomicflux has joined #ocaml
sam_ has joined #ocaml
ziyourenxiang has quit [Ping timeout: 246 seconds]
mfp__ has quit [Ping timeout: 260 seconds]
troydm has quit [Ping timeout: 240 seconds]
troydm has joined #ocaml
BitPuffin has quit [Ping timeout: 240 seconds]
sam_ has quit [Ping timeout: 240 seconds]
nomicflux has quit [Quit: nomicflux]
pierpa has quit [Quit: Page closed]
https_GK1wmSU has joined #ocaml
FreeBirdLjj has joined #ocaml
https_GK1wmSU has left #ocaml [#ocaml]
FreeBirdLjj has quit [Remote host closed the connection]
nomicflux has joined #ocaml
copy_ has quit [Quit: Connection closed for inactivity]
jlongster has joined #ocaml
sam_ has joined #ocaml
sam_ has quit [Ping timeout: 246 seconds]
MercurialAlchemi has joined #ocaml
nomicflux has quit [Quit: nomicflux]
sam_ has joined #ocaml
malina has quit [Quit: Throwing apples of Montserrat]
sam_ has quit [Ping timeout: 255 seconds]
mengu_ has quit [Remote host closed the connection]
malina has joined #ocaml
malina has quit [Remote host closed the connection]
enterprisey has joined #ocaml
average has quit [Remote host closed the connection]
sh0t has quit [Remote host closed the connection]
raphaelss has quit [Quit: leaving]
govg has quit [Ping timeout: 240 seconds]
jlongster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
samrat_ has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
TheGrimFandango has joined #ocaml
<TheGrimFandango> hi
<TheGrimFandango> I have a super basic question should it be a sensible place to ask.
<TheGrimFandango> I have something similar to: "let cur = Stream.peek s in let f = Stream.junk s; cur in"
enterprisey has quit [Ping timeout: 240 seconds]
<TheGrimFandango> I had expected naively that f would not be set until I actually used it in some way as happens if I add a parameter to "f", however it appears to get called immediately.
enterprisey has joined #ocaml
<TheGrimFandango> Is there an accepted way to delay such a value from getting called until it is actually called from in some match logic?
<TheGrimFandango> lazy?
ygrek has quit [Ping timeout: 255 seconds]
TheGrimFandango has quit [Remote host closed the connection]
al-damiri has quit [Quit: Connection closed for inactivity]
MercurialAlchemi has joined #ocaml
sam_ has joined #ocaml
ohama has quit [Ping timeout: 260 seconds]
enterprisey has quit [Ping timeout: 240 seconds]
TheGrimFandango has joined #ocaml
enterprisey has joined #ocaml
sam_ has quit [Ping timeout: 260 seconds]
ohama has joined #ocaml
TheGrimFandango has quit [Remote host closed the connection]
samrat_ has quit [Ping timeout: 255 seconds]
zpe has joined #ocaml
peterpp has joined #ocaml
govg has joined #ocaml
dejanr has joined #ocaml
dejanr has quit [Read error: Connection reset by peer]
dejanr_home has joined #ocaml
nahra has joined #ocaml
Simn has joined #ocaml
Sim_n has joined #ocaml
dejanr_home has quit [Ping timeout: 268 seconds]
Sim_n has quit [Quit: Leaving]
KeyJoo has joined #ocaml
andreas_ has joined #ocaml
https_GK1wmSU has joined #ocaml
https_GK1wmSU has left #ocaml [#ocaml]
enterprisey has quit [Remote host closed the connection]
sam_ has joined #ocaml
sam_ has quit [Ping timeout: 240 seconds]
mfp__ has joined #ocaml
freusque has joined #ocaml
https_GK1wmSU has joined #ocaml
https_GK1wmSU has left #ocaml [#ocaml]
nahra has quit [Remote host closed the connection]
dakk has joined #ocaml
nahra has joined #ocaml
zpe has quit [Remote host closed the connection]
bruce_r has quit [Ping timeout: 258 seconds]
gasche has joined #ocaml
ziyourenxiang has joined #ocaml
ziyourenxiang has quit [Changing host]
ziyourenxiang has joined #ocaml
ziyourenxiang has quit [Client Quit]
ziyourenxiang has joined #ocaml
dhil has joined #ocaml
zpe has joined #ocaml
sam_ has joined #ocaml
mrvn has left #ocaml [#ocaml]
sam_ has quit [Ping timeout: 276 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
kakadu has joined #ocaml
copy_ has joined #ocaml
samrat_ has joined #ocaml
lyxia has quit [Remote host closed the connection]
lyxia has joined #ocaml
samrat_ has quit [Ping timeout: 246 seconds]
zpe has joined #ocaml
mengu has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
sgnb has joined #ocaml
zpe has joined #ocaml
mengu_ has joined #ocaml
mengu has quit [Ping timeout: 248 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
sam_ has joined #ocaml
zpe has quit [Ping timeout: 258 seconds]
sam_ has quit [Ping timeout: 240 seconds]
_andre has joined #ocaml
axiles has quit [Ping timeout: 240 seconds]
<orbifx[m]> TheGrimFandango: still here?
nomicflux has joined #ocaml
mengu has joined #ocaml
mengu_ has quit [Ping timeout: 260 seconds]
<peterpp> when I run this it prints the same number twice: https://gist.github.com/anonymous/ea690b8b062f6b00f88ab4335fe0afbf
<peterpp> why is this?
<octachron> peterpp, since get_timestamp is an int, it is evaluated once. Since OCaml is eagerly evaluated, the value of "get_stamp" is computed when it is defined
<peterpp> ah interesting
<peterpp> how would I circumvent this?
lostman has quit [Quit: Connection closed for inactivity]
<peterpp> or otherwise obtain a current timestamp
<octachron> you could define "let get_timestamp ()= … "
copy_ has quit [Quit: Connection closed for inactivity]
<octachron> which is equivalent to "let get_timestamp: unit -> int = fun () -> … "
<octachron> in other words, it is a function that takes "()" as argument and returns an int
axiles has joined #ocaml
<peterpp> oh.. it was not actually a function at all
<peterpp> thank you
BitPuffin|osx has joined #ocaml
Soni has quit [Ping timeout: 260 seconds]
nomicflux has quit [Quit: nomicflux]
silver has joined #ocaml
abeaumont has quit [Remote host closed the connection]
abeaumont has joined #ocaml
Soni has joined #ocaml
ski has quit [Ping timeout: 260 seconds]
sam_ has joined #ocaml
jlongster has joined #ocaml
<sam_> So somebody told me last night that Core contains a bigstring module. What's the best way to introduce Core to my project? Do I just add "core" to my opam file?
<theblatte> sam_: pretty much yes
<theblatte> also to ocamlbuild/whatever
<sam_> ok, ill give it a try
sh0t has joined #ocaml
jlongster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jlongster has joined #ocaml
ristos has joined #ocaml
jlongster has quit [Client Quit]
jlongster has joined #ocaml
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 255 seconds]
aciniglio has joined #ocaml
copy_ has joined #ocaml
aciniglio has quit [Read error: Connection reset by peer]
sam_ has quit [Ping timeout: 240 seconds]
mengu has quit [Read error: Connection reset by peer]
mengu_ has joined #ocaml
sepp2k has joined #ocaml
peterpp has quit [Ping timeout: 260 seconds]
mengu has joined #ocaml
zv has quit [Ping timeout: 240 seconds]
mengu_ has quit [Ping timeout: 260 seconds]
<orbifx[m]> is matching on lists considered inefficient?
<orbifx[m]> so if I had `let [ a, b, c, d ] = some_list` ?
<companion_cube> no, it's fast
<orbifx[m]> or is it better to use nth etc?
<companion_cube> faster than calling nth 4 times, clearly
<orbifx[m]> cool thanks companion_cube
<Drup> List.nth is not efficient and should basically never be used
<orbifx[m]> Do you know how it's done?
al-damiri has joined #ocaml
sz0 has joined #ocaml
<companion_cube> it traverses the list
gregoire has left #ocaml [#ocaml]
yomimono has joined #ocaml
<orbifx[m]> cool
malina has joined #ocaml
<orbifx[m]> companion_cube: what about the compiler warning for other cases?
<companion_cube> well you could disable it if you're sure the list has that shape
<companion_cube> or do `match l with … | _ -> assert false in`
sh0t has quit [Ping timeout: 260 seconds]
sh0t has joined #ocaml
Anarchos has joined #ocaml
Anarchos has quit [Remote host closed the connection]
<orbifx[m]> how do you disable it? some kind of `[@...]` or ?
<orbifx[m]> I just thought it would raise an exception if it didn't match companion_cube
FreeBirdLjj has joined #ocaml
keyjoo_ has joined #ocaml
KeyJoo has quit [Ping timeout: 260 seconds]
<companion_cube> it would, yeah
rostero has joined #ocaml
BitPuffin|osx has quit [Remote host closed the connection]
<Drup> rgrinberg: you tried jbuildering tyxml at some point, didn't you ? Did you put the code somewhere ?
<rgrinberg> Drup: yes, IIRC it failed b/c jbuilder's mli hack didn't work for tyxml
* Drup sight.
sam_ has joined #ocaml
<Drup> I can take a look, can you push the code somewhere ?
mrvn has joined #ocaml
<rgrinberg> I put it up as a PR
<Drup> No need, I'll probably rework it before merging :)
<rgrinberg> oh, it was just the easiest way for me to pass it over
sam_ has quit [Ping timeout: 260 seconds]
<rgrinberg> yeah there's a ton of work left there
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu has quit [Ping timeout: 255 seconds]
sapristi has joined #ocaml
<sapristi> hello
<sapristi> there seem to be a problem with the BatMultiPMap module from batteries
<sapristi> hem nevermind
yomimono has quit [Quit: Ex-Chat]
dhil has quit [Ping timeout: 240 seconds]
slash^ has joined #ocaml
sapristi has quit [Quit: Leaving]
dhil has joined #ocaml
bruce_r has joined #ocaml
dhil has quit [Ping timeout: 248 seconds]
sam_ has joined #ocaml
raphaelss has joined #ocaml
sam_ has quit [Ping timeout: 260 seconds]
<theblatte> I'm looking into jbuildering a project whose source files are scattered across multiple directories, and there are circular dependencies between these directories
<theblatte> how do I tell jbuilder where to find all my source files?
<rgrinberg> theblatte: you can use copy stanzas to fool jbuilder into thinking that all the sources are in 1 dir
<rgrinberg> But it's very painful. If you can't reorganize your project then jbuilder might not be the right choice
<theblatte> ah, so I have to make a new temp dir where I physically copy all my files?
<theblatte> well I have a Makefile on top, I was hoping to just replace the call to ocamlbuild
<theblatte> the Makefile knows the list of source files, I was thinking it could generate a jbuild
<rgrinberg> Yeah, that doesn't like a good idea.
<rgrinberg> Why do you need a makefile if you want to port to jbuilder?
<theblatte> changing the project to fit jbuilder's opinions would be lots of work, so I was wondering how bad it would be to use jbuilder instead of ocamlbuild instead
<theblatte> in particular one painful point would be sorting the current directory spaghetti into separate, non-mutually recursive "libraries" that jbuilder expects for a proper migration
andreas_ has quit [Quit: Connection closed for inactivity]
<rgrinberg> Yup... But you will need to do that regardless
<theblatte> rgrinberg: what is not a good idea here more precisely, if you have some intuition? will jbuilder not perform well if I (copy# ...) every source file?
<rgrinberg> Either with copying files yourself or using copying rules in jbuilder
<rgrinberg> No, it will perform fine. It will actually symlink things on Linux rather than copy.
<theblatte> copying them all into one dir is not the same as reorganising them
<rgrinberg> But your build system will be spaghetti
<rgrinberg> Sure.. It could be the lesser evil if it really is that bad
<theblatte> well...
<theblatte> eye of the beholder, all that
<rgrinberg> Why not just do the copying yourself then?
<theblatte> sure, I can do that, I was wondering what I was supposed to do :)
<rgrinberg> If the directories have no real meaning and have dependency cycles
<theblatte> I never said they had no real meaning
<theblatte> they just don't have the meaning of being separate dependencies with a partial order between them ;)
axiles has quit [Read error: Connection reset by peer]
<rgrinberg> Lol, well that is very unusual. Ocamlbuild is so nice for allowing this stuff
<rgrinberg> Ah well, I think you know your options now though :)
<theblatte> yes, thanks :)
<theblatte> now to translate these _tags into something jbuilder understands...
leah2 has quit [Ping timeout: 246 seconds]
kakadu has quit [Quit: Konversation terminated!]
FreeBirdLjj has quit [Remote host closed the connection]
leah2 has joined #ocaml
BitPuffin|osx has joined #ocaml
FreeBirdLjj has joined #ocaml
keyjoo_ has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Ping timeout: 260 seconds]
dejanr has joined #ocaml
dejanr has quit []
dejanr has joined #ocaml
dejanr has quit [Client Quit]
dejanr has joined #ocaml
Mercuria1Alchemi has joined #ocaml
dejanr has quit []
dejanr has joined #ocaml
kakadu has joined #ocaml
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 240 seconds]
<theblatte> initial test: 3x speedup for jbuilder over ocamlbuild, guess it's worth the hacks :p
<Drup> that seems actually rather small ^^'
<theblatte> Drup: gasp :)
<theblatte> Drup: what would be typical?
<theblatte> Drup: also, maybe jbuilder shines even better on incremental builds?
<Drup> that was half humorous. I'm not sure there is a "typical" speed up
keyjoo_ has joined #ocaml
<theblatte> Drup: ok, thought as much but was wondering about others' experiences
keyjoo_ has quit [Client Quit]
slash^ has quit [Read error: Connection reset by peer]
jlongster has quit [Quit: Textual IRC Client: www.textualapp.com]
ErikRose has joined #ocaml
jnavila has joined #ocaml
mrvn has quit [Remote host closed the connection]
sam_ has joined #ocaml
sam_ has quit [Ping timeout: 240 seconds]
BitPuffin|osx has quit [Ping timeout: 246 seconds]
al-damiri has quit [Quit: Connection closed for inactivity]
mrvn has joined #ocaml
andreas_ has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 260 seconds]
rostero has quit [Quit: Connection closed for inactivity]
https_GK1wmSU has joined #ocaml
https_GK1wmSU has left #ocaml [#ocaml]
tg has quit [Read error: Connection reset by peer]
sillyotter has joined #ocaml
sillyotter has quit [Client Quit]
jnavila has quit [Remote host closed the connection]
_andre has quit [Quit: leaving]
mengu has joined #ocaml
mengu has quit [Remote host closed the connection]
mengu has joined #ocaml
mengu_ has joined #ocaml
mengu has quit [Ping timeout: 260 seconds]
sh0t has quit [Remote host closed the connection]
peterpp has joined #ocaml
ErikRose has quit [Ping timeout: 260 seconds]
Simn has quit [Quit: Leaving]
sam_ has joined #ocaml
sz0 has quit [Quit: Connection closed for inactivity]
dreadedfrog has quit [Ping timeout: 260 seconds]
profan has quit [Remote host closed the connection]
sam_ has quit [Ping timeout: 246 seconds]
pierpa has joined #ocaml
sepp2k has quit [Ping timeout: 240 seconds]
profan has joined #ocaml
al-damiri has joined #ocaml
<dxtr> Speaking of jbuilder; What'd be the easiest way to infer mli files in a jbuilder project?
profan has quit [Remote host closed the connection]
profan has joined #ocaml
average has joined #ocaml
https_GK1wmSU has joined #ocaml
sam_ has joined #ocaml
https_GK1wmSU has left #ocaml [#ocaml]
sh0t has joined #ocaml
Fardale has quit [Ping timeout: 240 seconds]
Fardale has joined #ocaml
tg has joined #ocaml
kakadu_ has quit [Remote host closed the connection]
<sam_> companion_cube: I tried pinning the latest version of qcheck and using QCheck.Test.fail_report but the long message is not showing up in my ounit tests.
dmruiz has joined #ocaml
<sam_> Does Core have anything for doing something like this: 'a' .. 'c' => ['a'; 'b'; 'c']?
peterpp has quit [Ping timeout: 260 seconds]
sh0t has quit [Ping timeout: 260 seconds]
<dmruiz> Hello, Can anyone explain me what does " = b_type = " means in "type t = b_type = {...}"?
<dmruiz> where "b_type" is another type previously defined
<sam_> could it be just a type alias?
<sam_> <- not an OCaml expert
sh0t has joined #ocaml
peterpp has joined #ocaml
<Drup> dmruiz: it indicates that the type t, which you are just defining, is equal to another type already defined name b_type, and you then restate the definition of b_type
<smondet[m]> + restating the definition brings the field/variant names into scope
<dxtr> That sounds like a maintenance nightmare
profan has quit [Remote host closed the connection]
<Drup> Not really, no
<Drup> There are two usecases 1) restating a type that you defined in another part of the library to expose it at a better place in the API 2) ensuring the type you are using is the one you expect
<Drup> 1) is a lot more common than 2)
<dxtr> right
http_GK1wmSU has joined #ocaml
http_GK1wmSU has quit [Excess Flood]
<sam_> hmm, why is Merlin telling me Random.State is an unbound module? thought it was in the standard lib.
<dmruiz> ok i got it, thanks
peterpp has quit [Ping timeout: 260 seconds]
nicooo has joined #ocaml
peterpp has joined #ocaml
nicoo has quit [Ping timeout: 248 seconds]
<sam_> Seems like I can't use Random.State if I `open Core` but I don't understand why
<peterpp> sam_, what exactly does not work?
malina has quit [Ping timeout: 255 seconds]