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
troydm has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
average has quit [Ping timeout: 258 seconds]
average has joined #ocaml
rostero has quit [Quit: Connection closed for inactivity]
ryanartecona has joined #ocaml
jao has quit [Remote host closed the connection]
ryanartecona has quit [Client Quit]
jao has joined #ocaml
KeyJoo has quit [Read error: Connection reset by peer]
enterprisey has quit [Remote host closed the connection]
KeyJoo has joined #ocaml
cranmax has quit [Quit: Connection closed for inactivity]
mfp__ has quit [Ping timeout: 240 seconds]
swalk has joined #ocaml
axiles has quit [Ping timeout: 260 seconds]
axiles has joined #ocaml
mrkgnao has joined #ocaml
govg has quit [Ping timeout: 240 seconds]
swalk has quit [Quit: swalk]
KeyJoo has quit [Read error: Connection reset by peer]
KeyJoo has joined #ocaml
swalk has joined #ocaml
ziyourenxiang has quit [Ping timeout: 240 seconds]
samrat_ has joined #ocaml
alexelcu has quit [Remote host closed the connection]
alexelcu has joined #ocaml
FreeBirdLjj has joined #ocaml
SoniEx2 is now known as Soni
samrat_ has quit [Ping timeout: 260 seconds]
swalk has quit [Quit: swalk]
_whitelogger has joined #ocaml
samrat_ has joined #ocaml
jao has quit [Remote host closed the connection]
samrat_ has quit [Ping timeout: 260 seconds]
jao has joined #ocaml
jao has quit [Ping timeout: 255 seconds]
copy_ has quit [Quit: Connection closed for inactivity]
al-damiri has quit [Quit: Connection closed for inactivity]
samrat_ has joined #ocaml
govg has joined #ocaml
wagle has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
sam____ has joined #ocaml
wagle has joined #ocaml
KeyJoo has quit [Ping timeout: 240 seconds]
enterprisey has joined #ocaml
mrkgnao has quit [Read error: Connection reset by peer]
govg has quit [Ping timeout: 260 seconds]
govg has joined #ocaml
MercurialAlchemi has joined #ocaml
gasche` has left #ocaml ["ERC (IRC client for Emacs 24.5.1)"]
jlam_ has joined #ocaml
jlam__ has quit [Ping timeout: 240 seconds]
peterpp__ has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
ziyourenxiang has joined #ocaml
malina has joined #ocaml
<sam____> hello, how can i get stack traces when running something through jbuilder?
dakk has quit [Read error: Connection reset by peer]
dakk has joined #ocaml
MercurialAlchemi has joined #ocaml
samrat_ has quit [Ping timeout: 260 seconds]
sam____ has quit [Ping timeout: 255 seconds]
enterprisey has quit [Read error: Connection reset by peer]
samrat_ has joined #ocaml
kakadu has joined #ocaml
malina has quit [Remote host closed the connection]
michael_ has joined #ocaml
Simn has joined #ocaml
kakadu has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 248 seconds]
michael_ has quit [Read error: Connection reset by peer]
michael_ has joined #ocaml
kakadu has joined #ocaml
cranmax has joined #ocaml
kakadu has quit []
kakadu has joined #ocaml
mfp__ has joined #ocaml
nullifidian has joined #ocaml
kakadu has quit [Client Quit]
kakadu has joined #ocaml
kakadu has quit [Client Quit]
kakadu has joined #ocaml
zpe has joined #ocaml
kakadu has quit [Client Quit]
kakadu has joined #ocaml
kakadu has quit [Client Quit]
kakadu has joined #ocaml
michael_ has quit [Quit: Leaving]
kakadu has quit []
kakadu has joined #ocaml
slash^ has joined #ocaml
dejanr has quit [Quit: Textual IRC Client: www.textualapp.com]
dejanr has joined #ocaml
kakadu has quit [Remote host closed the connection]
kakadu has joined #ocaml
silver has joined #ocaml
andreas_ has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
zpe_ has joined #ocaml
samrat_ has quit [Ping timeout: 248 seconds]
zpe_ has quit [Remote host closed the connection]
sam____ has joined #ocaml
sam____ has quit [Ping timeout: 260 seconds]
sam_____ has joined #ocaml
<sam_____> is the creator of mparser active in this channel (cakeplus on github)?
<peterpp__> what's the best way to access the documentation for core.std?
<sam_____> been trying to figure out how i could define a recursively defined parser but not having any luck yet. it seems it would have to involve laziness, like here: https://github.com/inhabitedtype/angstrom/blob/master/lib/angstrom.ml#L643
FreeBirdLjj has quit [Remote host closed the connection]
sam_____ has quit [Ping timeout: 248 seconds]
sam____ has joined #ocaml
<peterpp__> theblatte, somehow I find the interface rather cumbersome to use
<peterpp__> anyone here using merlin with emacs?
<peterpp__> if so, how did you manage to get auto completions for Core.Std?
sveit has quit [Ping timeout: 276 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 248 seconds]
kakadu has quit [Ping timeout: 240 seconds]
kakadu has joined #ocaml
samrat_ has joined #ocaml
<smondet[m]> sam_____: I don't think I've seen cakeplus on here, your question is worth an issue on the github repo.
cranmax has quit [Quit: Connection closed for inactivity]
jlam__ has joined #ocaml
samrat_ has quit [Ping timeout: 255 seconds]
jlam_ has quit [Ping timeout: 260 seconds]
sh0t has joined #ocaml
jlam_ has joined #ocaml
jlam__ has quit [Ping timeout: 255 seconds]
FreeBirdLjj has joined #ocaml
jlam__ has joined #ocaml
jlam_ has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Ping timeout: 260 seconds]
malina has joined #ocaml
jlam__ has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
jlam_ has joined #ocaml
jlam__ has joined #ocaml
jlam2 has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
jlam_ has quit [Ping timeout: 240 seconds]
lostman has joined #ocaml
jlam__ has quit [Ping timeout: 268 seconds]
malina has quit [Remote host closed the connection]
<sam____> smondet[m]: I'm already trying to rewrite my implementation using angstrom
malina has joined #ocaml
swalk has joined #ocaml
tianon has quit [Ping timeout: 240 seconds]
tianon has joined #ocaml
mali__ has joined #ocaml
<sam____> seliopou: am I misunderstanding about angstrom's sample JSON parser or is there a bug in parsing the attribute names?
<sam____> I don't see where the closing double quote is parsed
<sam____> There's just this: `let mem = lift2 pair (quo *> str <* ns) json in` <- I also wasn't able to figure out what S.str is
jlam_ has joined #ocaml
malina has quit [Remote host closed the connection]
mali__ has quit [Remote host closed the connection]
jlam2 has quit [Ping timeout: 240 seconds]
malina has joined #ocaml
MercurialAlchemi has joined #ocaml
FreeBirdLjj has joined #ocaml
cranmax has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
cranmax2 has joined #ocaml
ryanartecona has joined #ocaml
zpe has joined #ocaml
FreeBirdLjj has joined #ocaml
<sam____> wheee! it seems like it might be working. at least i managed to get past my stack overflows.
zpe has quit [Ping timeout: 248 seconds]
ryanartecona has quit [Quit: ryanartecona]
<sam____> how do I use ppx_deriving with jbuilder?
<rgrinberg> You can't yet because released ppx deriving doesn't use omp
sh0t has quit [Remote host closed the connection]
<rgrinberg> There's a branch that fixes it
<sam____> darn
ollehar has joined #ocaml
<sam____> i just noticed that i was spending quite some time doing something that is basically "deriving show"
<sam____> and then two structures that i evaluated to the same string were not considered equal for some reason.
<sam____> so would be helpful to automate those parts
<sam____> Expected query: select (All, (Table helloworld.csv) where false) was not equal to actual query: select (All, (Table helloworld.csv) where true)
<sam____> not equal
<sam____> :(
malina has quit [Remote host closed the connection]
<sam____> is there some typical mistake i would be likely to be doing here?
<sam____> oh btw that is the wrong pasted line where i changed the true to false just for testing :)
<sam____> hmm, so if i dont derive eq using ppx_deriving what would happen when trying to compare two values using ounit?
<rgrinberg> If you want to print stuff generically, ppx sexp conv is good
<sam____> well im using jbuilder now
<sam____> so i guess im screwed
<rgrinberg> In general, the current situation today is that ppx_type_conv is better supported by omp and consequently jbuilder
<rgrinberg> So no you aren't screwed
<rgrinberg> Unless you insist on using ppx deriving
<octachron> sam____, by default ounit will use the standard polymorphic comparison function, if you need a coarser equality, you need to provide your own
<rgrinberg> octachron: I think he wants printers for when things aren't equal :D
<sam____> ah so ppx_type_conv is different from ppx_deriving
<sam____> i want a working equality function and a working show : `a -> string function
<rgrinberg> Yes. They do similar things but implementation wise completely independent
<rgrinberg> A working equality function is just polymorphic equality like octachron said
<companion_cube> ppx_deriving.{eq,show}?
<sam____> rgrinberg: ah ok. great.
<rgrinberg> A working show would be first convert something to sexp and then to string
<rgrinberg> I would avoid ppx deriving until it works with omp and consequently 4.05
<companion_cube> :D
<sam____> so what does the `eq` of ppx_deriving give over the standard polymorphic comparison?
<companion_cube> personnally I just hand-write printers
<companion_cube> using some combinators + custom functions
<companion_cube> sam____: it's useful when you mix custom equality functions and automatically generated ones
<sam____> i just wrote one and it felt tedious
<companion_cube> a good chunk of my code is printing functions
<companion_cube> but then you gain control, and you can print however you like
<sam____> and apparently my printing function is not helpful in pointing out why the values im expecting to be equal are not equal
jlam__ has joined #ocaml
<sam____> its not like i need ppx_deriving, it was just the first thing that showed up when googling for ocaml deriving show
<sam____> so how do i get started with ppx_type_conv in jbuilder?
swalk has quit [Quit: swalk]
<companion_cube> you mean it prints the same things twice?
<companion_cube> no idea about jbuilder
jlam_ has quit [Ping timeout: 255 seconds]
jao has joined #ocaml
sam____ has quit [Ping timeout: 268 seconds]
sam____ has joined #ocaml
<sam____> so both the generated strings seem to be the same but they are not considered equal
<sam____> so both the generated strings seem to be the same but they are not considered equal
<sam____> this is what my test is telling me: Expected query: select (All, (Table helloworld.csv) where true) was not equal to actual query: select (All, (Table helloworld.csv) where true)
<companion_cube> indeed
<companion_cube> and you didn't specify and equality function
<sam____> nope
<companion_cube> an*
<sam____> but i have other unit tests where the equality works
<companion_cube> does the type you compare contain hidden fields, in particular functions?
<sam____> not to my knowledge
<sam____> i dont think i know how to hide fields
<companion_cube> never mind then
<sam____> so im feeling i need to find a way to print out the values as sexps to really see where something is different
<sam____> where do i put (pps (ppx-type-conv)) in my jbuild file?
<octachron> sam____, this not so much a question of printing out values as sexps but rather printing out all informations and thus having a reversible mapping between the input type and its string representation
<companion_cube> no idea, must be in the docs
maarhart_ has joined #ocaml
<sam____> Error: External library "ppx-type-conv" not found.
<sam____> octachron: well i just assume that printing the sexps would include everything so that if i screwed up something in my custom printer i would notice that
maarhart_ has quit [Client Quit]
<sam____> ok got it to compile and run again
zpe has joined #ocaml
sh0t has joined #ocaml
jlam__ has quit [Ping timeout: 246 seconds]
sam____ has quit [Ping timeout: 260 seconds]
zpe has quit [Ping timeout: 268 seconds]
swalk has joined #ocaml
swalk has quit [Quit: swalk]
jlam_ has joined #ocaml
ollehar has quit [Quit: ollehar]
<rgrinberg> ppx_sexp_conv is what you want.
<rgrinberg> Take a look at cohttp for an example
FreeBirdLjj has quit [Remote host closed the connection]
Algebr has joined #ocaml
cranmax2 has quit [Read error: Connection reset by peer]
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
jlam_ has quit [Read error: Connection reset by peer]
jlam_ has joined #ocaml
<peterpp__> any recommendations for a simple and robust websocket library?
sam____ has joined #ocaml
lostman has quit [Quit: Connection closed for inactivity]
FreeBirdLjj has joined #ocaml
rostero has joined #ocaml
swalk has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 240 seconds]
sam____ has quit [Ping timeout: 255 seconds]
sh0t has quit [Ping timeout: 268 seconds]
ziyourenxiang has quit [Ping timeout: 268 seconds]
swalk has quit [Quit: swalk]
malina has joined #ocaml
copy_ has joined #ocaml
sam____ has joined #ocaml
peterpp__ has quit [Ping timeout: 240 seconds]
<sam____> ok, now i tried adding [@@deriving sexp] after my type query, but seems there is no `sexp_of_query` function available
enterprisey has joined #ocaml
<sam____> any idea how to use it?
cranmax has quit [Quit: Connection closed for inactivity]
enterprisey has quit [Quit: Leaving]
jimt_ has joined #ocaml
<sam____> any ideas how to debug?
jimt has quit [Ping timeout: 246 seconds]
<octachron> sam____, first, you should check that (for instance) "[%sexp_of: (int * int) list ] [1,2;3,4]" compiles
<octachron> to check that the ppx is invoked correctly, since attribute (i.e [@@deriving sexp]) can be dropped silently but not extension node like [%sexp_of: …]
<sam____> octachron: Is that something I should be testing in utop or?
<sam____> i was able to add some incantation of `(preprocess (pps (ppx_type_conv)))` that didn't cause any compiler errors
<octachron> sam__, you should try in the source where you are adding the attribute
<sam____> Error: Syntax error
<octachron> sam____, try outside of any phrase "let () = [%sexp_of: (int * int) list ] [1,2;3,4]"
<sam____> Error: Uninterpreted extension 'sexp_of'.
<octachron> which means that your build is misconfigured and ppx_sexp_conv is not invoked (or not in the right way)
<sam____> right, i couldnt really find a clear example how to configure jbuilder
<sam____> i just kind of tried to make jbuilder not output any errors
<rgrinberg> sam____: you got your project online somewhere
<sam____> yeah but i havent pushed these latest changes yet
<sam____> do you know of any example projects using jbuilder with ppx_type_conv?
malina has quit [Remote host closed the connection]
<rgrinberg> I did say cohttp:)
<sam____> you did?
<sam____> maybe i was offline?
<sam____> thanks, i think i noticed how to proceed
<sam____> so if i have a type that depends on other types i need to also make the contained types derive sexp right?
enterprisey has joined #ocaml
jlam__ has joined #ocaml
<sam____> ok so how do i convert the sexps to strings?
jlam__ has quit [Read error: Connection reset by peer]
enterprisey has quit [Remote host closed the connection]
<sam____> ok i found a string_of_sexp
jlam__ has joined #ocaml
<rgrinberg> You got it
<rgrinberg> There's also sexp.to_pretty_string or something like that
<rgrinberg> Which prints an indented sexp
<sam____> Whats this? Failure "string_of_sexp: atom needed"
jlam_ has quit [Ping timeout: 260 seconds]
<rgrinberg> Oh sorry, you got wrong method
<rgrinberg> Use Sexp.to_string or its pretty variant
<sam____> oh let me try that
<sam____> is this yet another package or
<sam____> i only have open Sexplib.Std so far?
<sam____> ah is this core's Sexp?
<sam____> ok i got it!
<sam____> thans
<sam____> now i can finally see why my unit test was failing
<sam____> and the fix was rather easy now
rk[ghost] has quit [Ping timeout: 268 seconds]
cranmax has joined #ocaml
segmond has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
cranmax has quit [Remote host closed the connection]
cranmax has joined #ocaml
cranmax has quit [Ping timeout: 240 seconds]
MercurialAlchemi has quit [Ping timeout: 248 seconds]
malina has joined #ocaml
tane has joined #ocaml
pierpa has joined #ocaml
<dxtr> And I'm getting http://lpaste.net/8788082371330048000 when I'm trying to use it
<dxtr> What I'm doing is: PGOCaml.prepare dbh ~query ~name ~types () after a PGOCaml.connect
<Drup> Can you pastebin the whole code ?
<dxtr> Because I want every new connection to prepare some statements
<Drup> Ligne 21 is a bad idea, change the name to not be confused with the normal PGOCaml then show the new error message
<dxtr> Hmm, right. I saw it being done like that in some code and it initially felt like a deent idea
<dxtr> decent*
<Drup> No, it's a rather terrible idea, it only make error messages more confusing :)
<dxtr> So I changed everything to Lwt_PGOCaml and now I'm getting http://lpaste.net/1762558134787768320
<Drup> Then you are just missing a bind operation somewhere :)
<dxtr> Oh, so I have to bind the return value of Lwt_PGOCaml.connect?
<Drup> you get a promise with something in it, and you want the something
<dxtr> I have literally never used lwt before so I'm learning
<dxtr> Yeah, I'm checking that too :)
<Drup> (the manual will be rewritten soon, but at least it should help a bit)
<dxtr> Neat
<dxtr> I'm actually liking ocaml more and more
<dxtr> Drup: Question: Do Lwt_pool assume the promise or the, uhm, bound value(?) or is that up to me?
<Drup> not sure I understand the question
<dxtr> Okay, so I'm doing Lwt_pool.create 16 ~validate connect
<dxtr> Should connect then return the promise that Lwt_PGOCaml.connect returns, the value I'm giving to Lwt_PGOCaml.prepare (The value within the bind) or is that completely up to me?
<Drup> it's up to you, but you can't really unpack a promise in isolation
<dxtr> right
dreadedfrog has joined #ocaml
tane has quit [Quit: Leaving]
Simn has quit [Read error: Connection reset by peer]
<dxtr> So now I'm getting this http://lpaste.net/4901079832500109312
<dxtr> On Lwt_pool.create
<Drup> A pool in a ref ? That does not seem like the best of ideas
<Drup> anyway, you mixed normal pgocaml and lwt pgocaml
<dxtr> I did
<dxtr> ?
<dxtr> Oh yeah I did
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0 has quit [Killed (adams.freenode.net (Nickname regained by services))]
infinity0 has joined #ocaml
peterpp__ has joined #ocaml
cranmax has joined #ocaml
cranmax has quit [Read error: Connection reset by peer]
cranmax3 has joined #ocaml
mengu has joined #ocaml
dakk has quit [Ping timeout: 260 seconds]
dreadedfrog has quit [Ping timeout: 268 seconds]
sh0t has joined #ocaml
peterpp__ has quit [Ping timeout: 240 seconds]
sh0t has quit [Ping timeout: 240 seconds]
yegods has joined #ocaml
andreas_ has quit [Quit: Connection closed for inactivity]
enterprisey has joined #ocaml
malina has quit [Quit: Throwing apples of Montserrat]
sam____ has quit [Ping timeout: 240 seconds]
ziyourenxiang has joined #ocaml
enterprisey has quit [Remote host closed the connection]
mengu has quit [Ping timeout: 260 seconds]
SomeDamnBody has joined #ocaml
mengu has joined #ocaml
cranmax3 has quit [Ping timeout: 255 seconds]
<SomeDamnBody> I'm getting a stack overflow using iter_edges with ocamlgraph. Is there anything I can do to get around it?
<SomeDamnBody> Basically, I'm importing a graph as a persistent graph. But I want it to be imperative...
ziyourenxiang has quit [Ping timeout: 240 seconds]
jbrown has quit [Remote host closed the connection]
cranmax has joined #ocaml
dreadedfrog has joined #ocaml
swalk has joined #ocaml
seangrove has joined #ocaml
dreadedfrog has quit [Ping timeout: 240 seconds]
<seangrove> Hey all, I'm running into an "Unbound type constructor" error I can't get around https://gist.github.com/sgrove/76c9c674be8b6ec2ec353e7ed2e74921
<seangrove> The crazy thing is the *same* switch works elsewhere in the same file. But right there, I get that error. And I can't get the data inside the type without destructuring it.
copy_ has quit [Quit: Connection closed for inactivity]
<dxtr> Oh yeah I did
<dxtr> Err
<dxtr> Sorry
<dxtr> So, using Lwt, is it possible to get just 'a from 'a Lwt.t?