adrien changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | Current MOOC: https://huit.re/ocamlmooc | OCaml 4.04.0 release notes: http://ocaml.org/releases/4.04.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
KV has quit [Quit: leaving]
ryanartecona has quit [Quit: ryanartecona]
snhmib has quit [Ping timeout: 240 seconds]
silver has quit [Read error: Connection reset by peer]
Mercuria1Alchemi has quit [Ping timeout: 240 seconds]
smondet has quit [Ping timeout: 256 seconds]
rcabaco has joined #ocaml
rcabaco has quit [Ping timeout: 252 seconds]
ltadeu has quit [Remote host closed the connection]
shinnya has joined #ocaml
antkong_ has joined #ocaml
madroach has quit [Ping timeout: 260 seconds]
FreeBirdLjj has joined #ocaml
madroach has joined #ocaml
wtetzner has joined #ocaml
wtetzner has quit [Remote host closed the connection]
antkong_ has quit [Quit: antkong_]
rcabaco has joined #ocaml
rcabaco has quit [Ping timeout: 248 seconds]
moei has quit [Quit: Leaving...]
mfp has quit [Ping timeout: 245 seconds]
NJBS has quit [Quit: Catastrophic failure.]
rcabaco has joined #ocaml
rcabaco has quit [Ping timeout: 252 seconds]
unbalancedparen has quit [Read error: Connection reset by peer]
P4Titan has joined #ocaml
unbalanced has joined #ocaml
<P4Titan> Hi all. Is there a way to export a module to be accessed in another file with a name different than its host file's name?
<P4Titan> host file's names: ie -- the file in which this module resides
Algebr`` has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
average has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
copy` has quit [Quit: Connection closed for inactivity]
shinnya has quit [Ping timeout: 252 seconds]
jao has quit [Remote host closed the connection]
\h has quit [Ping timeout: 240 seconds]
\h has joined #ocaml
ansiwen has quit [Read error: Connection reset by peer]
<P4Titan> Hi all. How should I approach serialization in Batteries?
ansiwen has joined #ocaml
<cheater> thizanne: i have? i don't think i have.
wtetzner has joined #ocaml
wtetzner has quit [Ping timeout: 240 seconds]
ansiwen has quit [Ping timeout: 256 seconds]
ansiwen has joined #ocaml
FreeBirdLjj has joined #ocaml
wtetzner has joined #ocaml
wtetzner has quit [Remote host closed the connection]
wtetzner has joined #ocaml
wtetzner has quit [Ping timeout: 240 seconds]
FreeBirdLjj has quit [Ping timeout: 240 seconds]
P4Titan has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
ryanartecona has joined #ocaml
Algebr`` has quit [Ping timeout: 255 seconds]
trepta has quit [Ping timeout: 248 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
ryanartecona has quit [Quit: ryanartecona]
wtetzner has joined #ocaml
wtetzner has quit [Ping timeout: 256 seconds]
FreeBirdLjj has joined #ocaml
nkhodyunya has joined #ocaml
rgrinberg has joined #ocaml
pierpa has quit [Ping timeout: 256 seconds]
madroach has quit [Quit: leaving]
tmtwd has joined #ocaml
madroach has joined #ocaml
tmtwd has quit [Quit: Leaving]
soupault has quit [Remote host closed the connection]
shinnya has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 260 seconds]
rgrinberg has quit [Ping timeout: 260 seconds]
moei has joined #ocaml
FreeBirdLjj has joined #ocaml
FreeBird_ has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 255 seconds]
freusque has joined #ocaml
snhmib has joined #ocaml
shinnya has quit [Ping timeout: 240 seconds]
slash^ has joined #ocaml
sspi has joined #ocaml
MercurialAlchemi has joined #ocaml
FreeBird_ has quit [Remote host closed the connection]
larhat has joined #ocaml
FreeBirdLjj has joined #ocaml
rcabaco has joined #ocaml
mfp has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
larhat has quit [Quit: Leaving.]
slash^ has quit [Read error: Connection reset by peer]
slash^ has joined #ocaml
sspi has quit [Quit: Connection closed for inactivity]
Algebr`` has joined #ocaml
infinity0_ has joined #ocaml
infinity0_ is now known as infinity0
infinity0 has joined #ocaml
infinity0 has quit [Killed (moon.freenode.net (Nickname regained by services))]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
infinity0 has quit [Remote host closed the connection]
FreeBirdLjj has quit [Remote host closed the connection]
infinity0 has joined #ocaml
FreeBirdLjj has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
slash^ has quit [Remote host closed the connection]
silver has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
slash^ has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
silver_ has joined #ocaml
jnavila has joined #ocaml
silver has quit [Ping timeout: 248 seconds]
_whitelogger has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
silver_ is now known as silver
average has quit [Ping timeout: 245 seconds]
average has joined #ocaml
SkeThuVe has joined #ocaml
jnavila has quit [Ping timeout: 252 seconds]
madroach has quit [Quit: leaving]
AlfredENeuman has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
AlfredENeuman has joined #ocaml
rand__ has joined #ocaml
<jerith> I want to write some tests for code that uses lwt and cohttp to talk to the network.
<jerith> Are there any specific tools I should be looking at?
<jerith> Or any good examples I can borrow from?
FreeBirdLjj has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
<jerith> Is it safe to just call Lwt_main.run in each test function?
jnavila has joined #ocaml
vicfred has joined #ocaml
<Drup> jerith: yes, that's perfectly fine. The important things is to avoid nesting Lwt_main.run calls, but calling it several time in a non-nested way is fine
<Algebr``> is it dangerous to run -rectypes?
<Algebr``> and how do you do the flag rectypes to merlin? FLG rectypes?
<Drup> the problem with rectypes is that it quite often accept expressions that are not the one you actually wanted to write, so you need to be quite careful
Sakarah has joined #ocaml
<Algebr``> so it might make some typing harder but not like something that can blow up at runtime?
octachron has joined #ocaml
<thizanne> I would say it's the opposite, typing is made easier, but then typing is supposed to prevent things from blowing up at runtime :p
P4Titan has joined #ocaml
<thizanne> or better said, not-typing is supposed to
<P4Titan> Hi all. I am trying to serialize some data, and from what I read, it seems using sexprs is the ocaml way to go
<P4Titan> How should I approach using sexprs in Batteries?
<octachron> Algebr``, I would say, typing with rectypes can be surprising: for instance "let rec elements = function [] -> [] | a :: q -> a @ q ;;" works with rectypes
<Drup> Algebr``: let's just say that it makes writing non-terminating recursion even easier
<Drup> P4Titan: so, what kind of things do you want to serialiaze, and what are you going to do with the serialized data ?
<Drup> Depending of the answer, different serialization techniques are appropriate
<Algebr``> thanks
FreeBirdLjj has quit [Ping timeout: 240 seconds]
<P4Titan> Drup: I would want to serialize a custom declared type where each of its constructors would probably contain, strings, ints, and possibly binary data
<P4Titan> or, by binary data, that could be another object's serialization
<Drup> P4Titan: yes, that's serialization, but what are you doing with it :)
<P4Titan> ic, I'm going to be sending this over TCP to a OCaml driven client
<Drup> ok, so network stuff. There are protobuf libraries in OCaml, including a deriving thing
<Algebr``> Drup: what was the gadt url package?
<Algebr``> right
<Drup> there is also https://github.com/Drup/tyre
<Drup> tyre is released and perfectly usable
<Drup> furl is a bit more WIP
<Algebr``> but furl is successor?
<Drup> not really, more like an extension, specialized for urls
orbifx has joined #ocaml
<Drup> furl uses tyre
<Algebr``> kk
<jerith> Drup: I get an error that looks like it comes from lwt when I do that: Fatal error: exception Unix.Unix_error(Unix.EINTR, "select", "")
<jerith> I guess I can find information about that on the internet.
<P4Titan> Drup: thanks, I shall look into it
<Drup> jerith: hu, no idea
<Drup> (yes, it's from lwt, but don't know why)
<jerith> It might be an OSX thing.
<Drup> probably, yes, but it should be auto-detected
<jerith> My other programs that use lwt are fine, though.
<Drup> you can try to change the Lwt_engine to libuv
<jerith> So maybe it's lwt and ounit or something.
<Drup> see Lwt_engine
shinnya has joined #ocaml
<Drup> Algebr``: if you have remarks on furl API, please do open bug reports
<Algebr``> probably will
smondet has joined #ocaml
ziyourenxiang has joined #ocaml
<P4Titan> Drup: what about the Marshal module
<Drup> P4Titan: do not send Marshal things on the wire, it's not safe
<P4Titan> why is that?
<Drup> marshal is unsafe, if you try to unmarshal some data that has been garbled in one way or another, it will cause segfaults
<P4Titan> hmm, but doesn't TCP ensure packet completeness? I'm just curious
<Algebr``> why segfaults and not exceptions
<Drup> Algebr``: marshal is designed to be as fast as possible
<P4Titan> So it uses C internally or something?
<Drup> yeah
<Drup> and it loads things in the ocaml memory representation directly
<Drup> so, yeah, unless you have important speed and sharing constraints and you are not afraid to get segfaults if your input get garbled, use something that is checked, like json, sexp or protobuf
shinnya has quit [Ping timeout: 258 seconds]
<Algebr``> something isn't type checking where the only difference in the reported type difference is _.. > and .. > for this open object
<Algebr``> maybe this is that rectypes oddities?
<Algebr``> heh, probably is, well this was fun.
<octachron> Algebr``, "_.." sounds more like the value restriction than rectypes
ziyourenxiang has quit [Quit: Leaving]
<Algebr``> I think you're right
P4Titan has quit [Remote host closed the connection]
orbifx has quit [Ping timeout: 258 seconds]
pierpa has joined #ocaml
<Algebr``> How can I turn a local abstract type into a subtype of an open object type? This type a should be an instance of type <foo: string; .. >
<octachron> A locally abstract type cannot be a subtype of anything, since an abstract type means (more or less) "a type on which there is no information available"
<Algebr``> hmm, then the compiler shouldn't tell me this error message
<Algebr``> since this could never be satisified
vicfred has quit [Quit: Leaving]
rpip has quit [Quit: Sleep... sleep... Zzz-_-zzZ]
larhat has joined #ocaml
fraggle_ has quit [Remote host closed the connection]
nkhodyunya has quit [Quit: Leaving.]
<octachron> Algebr``, which error message are you talking about?
rgrinberg has joined #ocaml
<Algebr``> I made a locally abstract type and then was told I needed to make it a subtype
fraggle_ has joined #ocaml
<Algebr``> cohttp can make a http server now over a unix socket??
Sakarah has quit [Remote host closed the connection]
Sakarah has joined #ocaml
freusque has quit [Ping timeout: 240 seconds]
<reynir> I don't think that's new
jnavila has quit [Ping timeout: 252 seconds]
trepta has joined #ocaml
kareeeeem has joined #ocaml
dhil has joined #ocaml
<Algebr``> new to me
mfp has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
<dmbaturin> Why ocplib-endian has no uint32 or uint64?
mfp has joined #ocaml
jnavila has quit [Ping timeout: 240 seconds]
Xadnem has joined #ocaml
jnavila has joined #ocaml
Algebr`` has quit [Ping timeout: 255 seconds]
nkhodyunya has joined #ocaml
jnavila has quit [Ping timeout: 252 seconds]
contempt has quit [Remote host closed the connection]
lucybun has quit [Quit: lucybun]
jnavila has joined #ocaml
lucybun has joined #ocaml
lucybun is now known as _avery
tane has joined #ocaml
fraggle_ has quit [*.net *.split]
fraggle_ has joined #ocaml
freusque has joined #ocaml
trepta has quit [Ping timeout: 240 seconds]
snhmib has quit [Read error: Connection reset by peer]
jnavila has quit [Ping timeout: 240 seconds]
sz0 has joined #ocaml
copy` has joined #ocaml
snhmib has joined #ocaml
chindy has joined #ocaml
gnuyoda has joined #ocaml
ryanartecona has joined #ocaml
chindy has quit [Remote host closed the connection]
nicoo has quit [Remote host closed the connection]
jnavila has joined #ocaml
nicoo has joined #ocaml
kareeeeem has quit [Quit: Connection closed for inactivity]
Xadnem has quit [Ping timeout: 258 seconds]
myst|fon has joined #ocaml
Flerex has joined #ocaml
cpdean has joined #ocaml
ryanartecona has quit [Quit: ryanartecona]
xorpse has joined #ocaml
shinnya has joined #ocaml
kakadu has joined #ocaml
henrytill has quit [Remote host closed the connection]
wtetzner has joined #ocaml
henrytill has joined #ocaml
shinnya has quit [Ping timeout: 252 seconds]
Sakarah has quit [Quit: No Ping reply in 180 seconds.]
Sakarah has joined #ocaml
slash^ has quit [Read error: Connection reset by peer]
wolfcore has quit [Ping timeout: 248 seconds]
wtetzner has quit [Remote host closed the connection]
octachron has quit [Quit: Leaving]
wolfcore has joined #ocaml
Xadnem has joined #ocaml
pyx has joined #ocaml
pyx has quit [Client Quit]
Sakarah has quit [Remote host closed the connection]
sz0 has quit [Quit: Connection closed for inactivity]
dhil has quit [Ping timeout: 240 seconds]
freusque has quit [Ping timeout: 248 seconds]
jnavila has quit [Ping timeout: 252 seconds]
<cojy> is there any way to have a reserved mutable register as a variable?
<cojy> or will a ref ever be optimized to it
Algebr`` has joined #ocaml
xorpse has quit [Ping timeout: 255 seconds]
orbifx has joined #ocaml
Xadnem has quit [Quit: leaving]
Xadnem has joined #ocaml
<Xadnem> clear
<Xadnem> set theme magick.theme
<Xadnem> clear
cpdean has quit [Quit: Leaving.]
xorpse has joined #ocaml
<Xadnem> clear
<Xadnem> clear
nkhodyunya has left #ocaml [#ocaml]
<orbifx> anyone written any libs to deal with paths in a type safe manner?
<zozozo> orbifx: what do you mean by safe ?
<zozozo> but in any case, there's Filename
<orbifx> one providing a way for the compiler to check path types, to avoid mingling invalid strings
<orbifx> I'm aware it can't protect for invalid values, but it can protect from function compisition
<orbifx> zozozo: is the from std?
<zozozo> maybe bos does what you want, but I'm not sure
<orbifx> thanks zozozo , although it doesn't provide a type
<zozozo> orbifx: just found out about fpath, which should do what you want (cf http://erratique.ch/software/fpath/doc/Fpath.html)
<orbifx> i'll provide a link for what I mean in a while
cpdean has joined #ocaml
<orbifx> cool, this will help in a way. Thanks zozozo
Orion3k has joined #ocaml
rand__ has quit [Quit: leaving]
antkong has joined #ocaml
<cpdean> i'm confused by this ocaml syntax
Flerex has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<Algebr``> first one is a polymorphic variant
<Algebr``> second is a plain variant
<cpdean> i've added a similar syntax that appears to be describing a similar kind of type https://gist.github.com/cpdean/8ccba7b26f23b27efa746f7a7e75ec6b
<cpdean> hmm… okay so i'm trying to add onto this book's json parsing example https://realworldocaml.org/v1/en/html/parsing-with-ocamllex-and-menhir.html
<Algebr``> Scroll down
<cpdean> is there some way to construct values from polymorphic variants? i get a compiler error https://gist.github.com/cpdean/88981a436838c9680f5716121df4539f
<Algebr``> you can just do `Null
<Algebr``> read the links about poly variants
<cpdean> oh and not need to open the Json module
kakadu has quit [Remote host closed the connection]
rgrinberg has quit [Ping timeout: 240 seconds]
tane has quit [Quit: Leaving]