companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
amiloradovsky has quit [Remote host closed the connection]
mxns has quit [Ping timeout: 265 seconds]
bartholin has quit [Quit: Leaving]
mxns has joined #ocaml
mxns has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
olle_ has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
olle has quit [Ping timeout: 264 seconds]
olle has joined #ocaml
nullcone has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
mfp has quit [Ping timeout: 256 seconds]
mxns has quit [Ping timeout: 264 seconds]
lopex has quit [Quit: Connection closed for inactivity]
Haudegen has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
madroach_ has joined #ocaml
madroach has quit [Ping timeout: 256 seconds]
waleee-cl has quit [Quit: Connection closed for inactivity]
mxns has joined #ocaml
Jeanne-Kamikaze has quit [Ping timeout: 260 seconds]
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 264 seconds]
rdivyanshu has joined #ocaml
vicfred has quit [Quit: Leaving]
flasd has quit [Ping timeout: 265 seconds]
mxns has joined #ocaml
mbuf has joined #ocaml
landonf has quit [Excess Flood]
landonf has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
narimiran has joined #ocaml
mxns has joined #ocaml
narimiran has quit [Ping timeout: 264 seconds]
narimiran has joined #ocaml
decentpenguin has quit [Quit: ZNC crashed or something]
decentpenguin has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
amiloradovsky has joined #ocaml
robmyers has quit [Ping timeout: 264 seconds]
<d_bot> <Lupus> I'm applying functor, and OCaml complains that the module that I pass does not match the signature
<d_bot> <Lupus> ```
<d_bot> <Lupus> Error: Signature mismatch:
<d_bot> <Lupus> ...
<d_bot> <Lupus> Values do not match:
<d_bot> <Lupus> val l :
<d_bot> <Lupus> (extra_info, Runtime.with_auth) Cloud.Auth_filter.provider list
<d_bot> <Lupus> is not included in
<d_bot> <Lupus> val l : (extra_info, 'a) Cloud.Auth_filter.provider list
<d_bot> <Lupus> ```
<d_bot> <Lupus> why can't it unify concrete type that I have with that `'a`?
robmyers has joined #ocaml
<d_bot> <ggole> Signatures aren't matched with unification, but by subsumption - and the problem here is that a less general type does not subsume the more general one (the type variable)
lopex has joined #ocaml
<d_bot> <Lupus> hm, are there any workarounds?
<d_bot> <ggole> Well, it kinda depends on what you're doing
<d_bot> <ggole> You can add a `type foo` to the signature, replace the `'a` with `foo` and use `with type foo = Runtime.with_auth`
mbuf has quit [Quit: Leaving]
<d_bot> <Lupus> I'm using fantom type to restrict the api, but functor works with both flavors (with_auth and without_auth)
dborisog has joined #ocaml
<d_bot> <Lupus> so my argument module needs to define `runtime` type, but I won't be able to say that both flavors are okay in this case, as that would introduce type parameter and won't match the signature as well
mxns has joined #ocaml
<d_bot> <ggole> Is the `runtime` type of the result the same as the one in the argument module? That should be ok.
shawnw has joined #ocaml
<d_bot> <Lupus> `runtime` type should be the same (as far as I understand the question)
<d_bot> <Lupus> just some argument modules support working with arbitrary runtimes (i.e. unbound type parameter) while some argument modules need specific runtime (e.g. type parameter is specifically with_auth), functor itself does not use specific API of runtime that needs exact type parameter
<d_bot> <Lupus> I'll try to add type to argument module signature and we'll see how it goes
<d_bot> <Lupus> I wonder if exposing the fact that fantom type is polyvariant will help and OCaml will be able to compose the constructors somehow? 🤔
noonien0 has joined #ocaml
noonien has quit [Ping timeout: 256 seconds]
noonien0 is now known as noonien
ldbeth has joined #ocaml
<ldbeth> does the equal function matter when using Ephemeron for memoization?
<ldbeth> given that Hashtbl.hash is used as the hash function
mxns has quit [Ping timeout: 264 seconds]
<d_bot> <Lupus> @ggole well, as I expected, it does not work really well :)
<d_bot> <Lupus> I've created a sketch to illustrate my point
<d_bot> <Lupus> meanwhile I'll try to expose the polyvariants and see of that works better
amiloradovsky has quit [Remote host closed the connection]
<d_bot> <ggole> The link is dead?
<d_bot> <Lupus> lol, I forked my own sketch, and now it shows 404 on the original...
<d_bot> <ggole> Right.
<d_bot> <Lupus> copy-pasted it manually
<d_bot> <Lupus> works now?
<d_bot> <ggole> Both 404, sorry
<d_bot> <Lupus> hmmm
<d_bot> <Lupus> looks like sketch.sh is badly broken at the moment, it gives me 404 as well
<d_bot> <Lupus> what are other popular choices to share OCaml/Reason code?
<d_bot> <Lupus> pasting it here will explode the IRC 😄
noonien has quit [Ping timeout: 260 seconds]
noonien6 has joined #ocaml
<d_bot> <ggole> I tend to use a gist, but you need an account for that iirc
ldbeth has quit [Quit: ERC (IRC client for Emacs 27.1)]
<d_bot> <ggole> You can get around that with an existential, https://gist.github.com/gsg/51477444322d5276a24179100243732c
<d_bot> <ggole> Ah, probably should make that `[@@unboxed]`
<d_bot> <Lupus> oh, nice!
<d_bot> <Lupus> I've also succeeded with exposing polyvariants and making runtime kind into the module type :)
<d_bot> <Lupus> that improves performance I assume?
<d_bot> <ggole> Yeah, it makes the constructor purely a compile-time thing
<d_bot> <ggole> Well, putting that aside you should hopefully be able to progress with one of those two approaches.
<d_bot> <Lupus> yeah, thanks for your help! I've used existentials couple times already to overcome with phantom variable, but for some reason didn't think about using them in this case
<d_bot> <Lupus> probably I'll stick with exposing polyvariants as that fits better into the api semantically compared to asking the users to specify whole runtime type (given that it can't be anything else than specific type with only type variable varying) and forcing the users to learn GADT in case their argument module is runtime-flavor agnostic 😄
mxns has joined #ocaml
mxns has quit [Ping timeout: 268 seconds]
bartholin has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
ArthurStrong has quit [Ping timeout: 265 seconds]
mfp has joined #ocaml
Tuplanolla has joined #ocaml
nullcone has quit [Quit: Connection closed for inactivity]
shawnw has quit [Quit: Leaving]
shawnw has joined #ocaml
olle_ has joined #ocaml
tane has joined #ocaml
Haudegen has joined #ocaml
oni-on-ion has quit [Remote host closed the connection]
oni-on-ion has joined #ocaml
mbuf has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
<d_bot> <Serpent7776> I've been looking at some ocaml sources and seen `caml_raise_*` functions that use `caml_global_data` https://github.com/ocaml/ocaml/blob/trunk/runtime/fail_byt.c#L185 - how is that data filled? I see it's read from "DATA" section, but what exactly is that? https://github.com/ocaml/ocaml/blob/trunk/runtime/startup_byt.c#L448
zv has joined #ocaml
zv has quit [Client Quit]
rdivyanshu has quit [Quit: Connection closed for inactivity]
<d_bot> <ggole> `caml_global_data` is an array of values of global identifiers iirc
dhil has joined #ocaml
<d_bot> <Serpent7776> how do you know that division by zero exception is at index 5? https://github.com/ocaml/ocaml/blob/trunk/runtime/caml/fail.h#L35
<d_bot> <ggole> The DATA section always has those values iirc? It's been quite a long time since I looked at that stuff...
Haudegen has quit [Ping timeout: 246 seconds]
<d_bot> <Serpent7776> it's the actual DATA section of ocamlrun executable?
<d_bot> <ggole> No, it's a bytecode thing
<d_bot> <ggole> That has a short explanation
mbuf has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
<d_bot> <jco> Hi! My program is calling two asynchronous functions simultaneously, and they both execute a git command on the same repository, so that one function fails since the repository is locked by another process. How would you solve this issue?
<d_bot> <jco> Maybe write a unique function that executes either one or both commands
<d_bot> <ggole> Chain the functions, eg, monadically?
mxns has quit [Ping timeout: 258 seconds]
<d_bot> <jco> Yes, it's just that the library I'm using (ocaml-graphql-server) apply functions to individual requests. Thus the problem arises when two requests are made in the same graphql request.
<d_bot> <jco> Maybe adding a timeout to the call to Lwt.pread could help
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
andreas303 has quit [Remote host closed the connection]
andreas303 has joined #ocaml
shawnw has quit [Ping timeout: 272 seconds]
mbuf has joined #ocaml
jbrown has quit [Ping timeout: 240 seconds]
jnavila has joined #ocaml
waleee-cl has joined #ocaml
jbrown has joined #ocaml
jbrown has quit [Ping timeout: 258 seconds]
<d_bot> <Serpent7776> I think I found it, but this doesn't preserve the order of exceptions https://github.com/ocaml/ocaml/blob/trunk/typing/predef.ml#L100
Jeanne-Kamikaze has joined #ocaml
jbrown has joined #ocaml
TheLemonMan has joined #ocaml
schlaftier has quit [Quit: Ping timeout (120 seconds)]
schlaftier has joined #ocaml
mbuf has quit [Quit: Leaving]
dborisog has quit [Ping timeout: 256 seconds]
andreas303 has quit [Write error: Broken pipe]
tryte has quit [Remote host closed the connection]
cantstanya has quit [Write error: Broken pipe]
nicoo has quit [Write error: Broken pipe]
tryte has joined #ocaml
cantstanya has joined #ocaml
nicoo has joined #ocaml
andreas303 has joined #ocaml
richbridger has joined #ocaml
Jesin has quit [Quit: Leaving]
Jesin has joined #ocaml
olle_ has quit [Ping timeout: 260 seconds]
nullcone has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Changing host]
neiluj has joined #ocaml
hnOsmium0001 has joined #ocaml
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
narimiran has quit [Ping timeout: 240 seconds]
jbrown has quit [Ping timeout: 272 seconds]
olle_ has joined #ocaml
l1x has joined #ocaml
neiluj has quit [Ping timeout: 260 seconds]
neiluj has joined #ocaml
neiluj has quit [Changing host]
neiluj has joined #ocaml
jbrown has joined #ocaml
neiluj has quit [Read error: Connection reset by peer]
neiluj has joined #ocaml
amiloradovsky has joined #ocaml
neiluj has quit [Ping timeout: 264 seconds]
neiluj has joined #ocaml
neiluj has quit [Read error: Connection reset by peer]
neiluj has joined #ocaml
jbrown has quit [Ping timeout: 264 seconds]
neiluj has quit [Quit: leaving]
Jeanne-Kamikaze has quit [Remote host closed the connection]
neiluj has joined #ocaml
neiluj has joined #ocaml
neiluj has quit [Changing host]
jnavila has quit [Ping timeout: 265 seconds]
neiluj has quit [Ping timeout: 260 seconds]
neiluj has joined #ocaml
bartholin has quit [Quit: Leaving]
neiluj has quit [Ping timeout: 240 seconds]
Jeanne-Kamikaze has joined #ocaml
dhil has quit [Ping timeout: 264 seconds]
GuerrillaMonkey has joined #ocaml
vicfred has joined #ocaml
Jeanne-Kamikaze has quit [Ping timeout: 246 seconds]
tane has quit [Quit: Leaving]
DanC has left #ocaml ["Leaving"]