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