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]"
<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]
<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?