companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 4.14.0 released: https://ocaml.org/releases/4.14.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
spip has quit [Quit: Konversation terminated!]
bartholin has quit [Quit: Leaving]
Tuplanolla has quit [Quit: Leaving.]
waleee has quit [Ping timeout: 265 seconds]
waleee has joined #ocaml
alexherbo2 has joined #ocaml
alexherbo2 has quit [Ping timeout: 260 seconds]
waleee has quit [Ping timeout: 265 seconds]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
tizoc has quit [Quit: Coyote finally caught me]
Haudegen has quit [Ping timeout: 260 seconds]
tizoc has joined #ocaml
alexherbo2 has joined #ocaml
alexherbo2 has quit [Ping timeout: 260 seconds]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
chrisz has quit [Ping timeout: 265 seconds]
chrisz has joined #ocaml
azimut has quit [Ping timeout: 255 seconds]
TakinOver has quit [Ping timeout: 268 seconds]
waleee has quit [Ping timeout: 252 seconds]
motherfsck has quit [Ping timeout: 255 seconds]
motherfsck has joined #ocaml
azimut has joined #ocaml
alexherbo2 has joined #ocaml
alexherbo2 has quit [Ping timeout: 260 seconds]
motherfsck has quit [Ping timeout: 272 seconds]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
TakinOver has joined #ocaml
mbuf has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TakinOver has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
azimut has quit [Ping timeout: 255 seconds]
xd1le has joined #ocaml
alexherbo2 has joined #ocaml
alexherbo2 has quit [Ping timeout: 260 seconds]
trev has joined #ocaml
bgs has joined #ocaml
bgs has quit [Remote host closed the connection]
jao has quit [Ping timeout: 272 seconds]
alexherbo2 has joined #ocaml
alexherbo2 has quit [Ping timeout: 260 seconds]
hsw_ has joined #ocaml
hsw has quit [Quit: Leaving]
hsw_ has quit [Remote host closed the connection]
hsw has joined #ocaml
mro has joined #ocaml
bartholin has joined #ocaml
alexherbo2 has joined #ocaml
bartholin has quit [Quit: Leaving]
zozozo has quit [Ping timeout: 265 seconds]
olle has joined #ocaml
mro has quit [Remote host closed the connection]
zozozo has joined #ocaml
spip has joined #ocaml
neiluj has joined #ocaml
<neiluj> Hi! is it possible to build a generator for a record with QCheck?
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zozozo> neiluj: there's no reason for it not to be possible, why do you ask ?
<zozozo> neiluj: it's likely not what you're looking for (since `return` is a constant generator, meaning, that it always return the same element), however, using functions such as `map` it's easy to transforma tuple generator into a record generator
troydm has quit [Changing host]
troydm has joined #ocaml
<neiluj> oh thanks, will do, saves me time :)
azimut has joined #ocaml
<neiluj> ok, this worked!
<neiluj> given a tuple of integers in range, how would you filter them so that they satisfy some relations with each other? like arg1 < arg2
<neiluj> something like filter
Haudegen has joined #ocaml
<zozozo> neiluj: you can add preconditions in the property being tested (cf https://github.com/c-cube/qcheck/#preconditions )
<zozozo> but, you can also use the bind operator: (>>=)
<zozozo> hm.. after a bit of a read through the doc, the simpler would be to directly generate correct values, rather than filter after the fact
<zozozo> e.g. `let ordered_tuple_gen = let open QCheck.Gen in int >>= fun arg1 -> pint >>= fun diff -> return (arg1, max (arg1 + diff) max_int)` would generate a pair of integers (arg1, arg2) such that arg1 <= arg2
<zozozo> neiluj: you might also be interested in looking at this library : https://github.com/gasche/random-generator/
<richardhuxton> Have just started exploring ocaml. I'm a database guy really, so was looking at PostgreSQL libraries. Am I right in thinking there isn't anything out there that handles types "properly" - so a daterange from PG is just going to be text on the ocaml end and I have to parse it myself?
<neiluj> many thanks zozozo, going to follow the simpler route you suggested!
bgs has joined #ocaml
<zozozo> richardhuxton: I don't know about postgresql, but there are at least type-safe interfaces for sqlite (e.g. sqlexpr, sqlite3_utils, ...)
<richardhuxton> Thanks zozozo - I'll take a look at those and see if there's anything useful in there.
zozozo has quit [Ping timeout: 248 seconds]
zozozo has joined #ocaml
<richardhuxton> -+
alexherbo2 has quit [Remote host closed the connection]
mro has joined #ocaml
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alexherbo2 has joined #ocaml
mro has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
SquidDev has quit [Quit: Bye!]
SquidDev has joined #ocaml
trev has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
mro has joined #ocaml
jao has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee has joined #ocaml
alexherbo2 has quit [Remote host closed the connection]
alexherbo2 has joined #ocaml
ephaptic has joined #ocaml
rgrinberg has joined #ocaml
ephaptic has quit [Quit: WeeChat 3.7.1]
mro has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Ping timeout: 260 seconds]
olle has quit [Remote host closed the connection]
mro has joined #ocaml
mro has quit [Quit: Leaving...]
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
malc has joined #ocaml
alexherbo2 has quit [Ping timeout: 260 seconds]
motherfsck has joined #ocaml
rgrinberg has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xd1le has quit [Quit: xd1le]
xgqt has quit [Ping timeout: 255 seconds]
xgqt has joined #ocaml
bartholin has joined #ocaml
olle has joined #ocaml
mbuf has quit [Quit: Leaving]
rgrinberg has joined #ocaml
ephaptic has joined #ocaml
wingsorc has joined #ocaml
neiluj has quit [Ping timeout: 252 seconds]
neiluj has joined #ocaml
waleee has quit [Quit: WeeChat 3.7.1]
fds has quit [Ping timeout: 268 seconds]
ephaptic has quit [Quit: WeeChat 3.7.1]
waleee has joined #ocaml
neiluj has quit [Read error: Connection reset by peer]
neiluj has joined #ocaml
mro has joined #ocaml
mro has quit [Read error: Connection reset by peer]
mro has joined #ocaml
fds has joined #ocaml
neiluj has quit [Ping timeout: 252 seconds]
olle has quit [Ping timeout: 268 seconds]
mro has quit [Quit: Leaving...]
bartholin has quit [Quit: Leaving]
keyboard has joined #ocaml
Guest84 has joined #ocaml
Guest84 has quit [Quit: Client closed]
keyboard has quit [Remote host closed the connection]
Tuplanolla has joined #ocaml