companion_cube changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.0 released(!!1!): https://ocaml.org/releases/5.0.0.html | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
Tuplanolla has quit [Quit: Leaving.]
<discocaml> <puppytamer> what is that
<discocaml> <functionalprogramming> what
rf has quit [Ping timeout: 260 seconds]
rf has joined #ocaml
chrisz_ has joined #ocaml
chrisz has quit [Ping timeout: 240 seconds]
gentauro has quit [Ping timeout: 252 seconds]
gentauro has joined #ocaml
spip has quit [Ping timeout: 240 seconds]
John_Ivan has quit [Ping timeout: 258 seconds]
rf has quit [Ping timeout: 260 seconds]
azimut_ has quit [Ping timeout: 240 seconds]
bartholin has joined #ocaml
gahr_ is now known as gahr
troydm has quit [Ping timeout: 240 seconds]
Serpent7776 has joined #ocaml
troydm has joined #ocaml
bgs has joined #ocaml
bartholin has quit [Quit: Leaving]
Serpent7776 has quit [Ping timeout: 252 seconds]
perrierjouet has quit [Server closed connection]
perrierjouet has joined #ocaml
mstevens has quit [Server closed connection]
mstevens has joined #ocaml
spip has joined #ocaml
Boarders___ has quit [Server closed connection]
Boarders___ has joined #ocaml
<discocaml> <xavierm02> I'd like to assert that a module `M` implements a signature `S` without restricting the public interface of the module to that signature. What's the standard way of doing this? The only way I can think of is applying a dummy functor `module F (X : S) = struct end` to `M`, but that's a bit ugly.
amk_ has joined #ocaml
amk has quit [Read error: Connection reset by peer]
amk_ is now known as amk
SquidDev has quit [Server closed connection]
SquidDev has joined #ocaml
<discocaml> <peuk> Fixed, hope the PR will be accepted.
<discocaml> <deepspacejohn> You can `include S` with the rest of its signature. https://ocaml.org/play#code=bW9kdWxlIHR5cGUgUyA9IHNpZwogIHR5cGUgdAogIHZhbCB6ZXJvOiB0CmVuZAoKbW9kdWxlIE06IHNpZwogIGluY2x1ZGUgUwogIHZhbCBpbmZpbml0eTogdAplbmQgPSBzdHJ1Y3QKICB0eXBlIHQgPSBmbG9hdAogIGxldCB6ZXJvID0gMC4wCiAgbGV0IGluZmluaXR5ID0gaW5maW5pdHkKZW5k
<discocaml> <xavierm02> @deepspacejohn Yes of course. I was trying to avoid writing the whole signature.
waleee has joined #ocaml
<discocaml> <deepspacejohn> You could also do `module M_check : S = M` which is similar to using a functor but simpler.
Serpent7776 has joined #ocaml
<discocaml> <deepspacejohn> which will create a module `M_check` which has a restricted signature, but does not effect `M`
<discocaml> <deepspacejohn> which will create a module `M_check` which has a restricted signature, but does not affect `M`
<discocaml> <._null._> You don't have to give it a name even : `module _ : S = M` should work the same
<discocaml> <smondet> you don't have to give it a name: `module _ : S = M`
<discocaml> <deepspacejohn> oh yes, of course! I forget you can do that with modules.
<discocaml> <smondet> but the initialization of M might be duplicated if you have side-effects
<discocaml> <smondet> (or not because it is just a module alias …)
<discocaml> <._null._> I don't know what module restriction can have as side-effects
<discocaml> <deepspacejohn> restricting a signature usually initializes a new module, right? since the runtime representation of all modules with the same signature have to match.
<discocaml> <smondet> it doesn't seem like it reruns in my case: ```
<discocaml> <smondet> ocaml# module M = struct type t = int let () = print_endline "hello" end;;
<discocaml> <smondet> hello
<discocaml> <smondet> module M : sig type t = int end
<discocaml> <smondet> ocaml# module _ : sig type t end = M;;
<discocaml> <smondet> ocaml#
<discocaml> <smondet> ```
<discocaml> <xavierm02> Perfect! Thank you!
<discocaml> <._null._> Apprently it copies the module moving around the pointers / immediates in its fields, but no initialisation (e.g. refs are shared)
<discocaml> <deepspacejohn> That makes sense, considering that otherwise initialization would have to happen every time you apply a functor.
<discocaml> <._null._> Initialisation does happen every time you apply a [generative] functor though
<discocaml> <deepspacejohn> I mean to the functor arguments, since the runtime needs to restrict the input modules to fit the signatures.
<discocaml> <._null._> Oh right, got you
<discocaml> <smondet> There exists an older version of OCaml that reexuctes the side-effects.
<discocaml> <smondet> this behavior comes from the "module aliases" feature
<discocaml> <smondet> this behavior comes from the "module aliases" feature (I think)
Leonidas has quit [Quit: An ideal world is left as an exercise to the reader]
Leonidas has joined #ocaml
John_Ivan has joined #ocaml
<discocaml> <regularspatula> Does anyone who use github CI with macOS find it to be sort of flaky with opam?
<zozozo> @regularspatula : except for it taking more time than on linux, I haven't had much problems with macos in CI runs (contrary to windows)
<discocaml> <regularspatula> Maybe it is just me...i just (re)found my own github issue from a year and a half ago (https://github.com/ocaml/setup-ocaml/issues/400) 😅
azimut has joined #ocaml
<discocaml> <a.penumbra> I wish there was OCaml for Cygwin, uhm. wait.
<discocaml> <a.penumbra> I wish there was OCaml for Windows not some cygwin sche- wait, I've said that already.
<discocaml> <a.penumbra> *sighs*
<discocaml> <Kali> there is ocaml for cygwin
<discocaml> <Kali> native support will come with opam 2.2
<discocaml> <a.penumbra> There is indeed. That's what makes me sad.
<discocaml> <a.penumbra> Not just sad.
<discocaml> <a.penumbra> Sadge.
<discocaml> <Kali> you can view the progress of opam 2.2 here
<discocaml> <Kali> you are welcome to help contribute
<discocaml> <a.penumbra> I'm partially satisfied using the toolsuite by running it in a VM or WSL
<discocaml> <a.penumbra> Just fully unsatisfied for not having it able to run with a win32 subsystem.
<discocaml> <Kali> i found cygwin to be a convenient option, especially due to two facts: it does not require administrative rights, and you can use built binaries as-is outside of cygwin
<discocaml> <a.penumbra> I uhm, use cygwin for something else.
<discocaml> <a.penumbra> Offtopic: Man, how I wish there was selenium for bash.
<discocaml> <a.penumbra> Or some sort of bash unit testing.
<discocaml> <._null._> There's a channel for off-topic
<discocaml> <Kali> #offtopic🎲
<discocaml> <a.penumbra> Heading there now.
<discocaml> <Kali> thanks
bartholin has joined #ocaml
<discocaml> <regularspatula> fwiw, I manually reran the macOS job and it build fine
rf has joined #ocaml
rf has quit [Ping timeout: 240 seconds]
azimut has quit [Remote host closed the connection]
sim642 has quit [K-Lined]
azimut has joined #ocaml
alexherbo2 has joined #ocaml
Tuplanolla has joined #ocaml
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
alexherbo2 has quit [Remote host closed the connection]
gareppa has joined #ocaml
gareppa has quit [Remote host closed the connection]
gareppa has joined #ocaml
sim642 has joined #ocaml
CalimeroTeknik has quit [Changing host]
CalimeroTeknik has joined #ocaml
waleee has quit [Ping timeout: 246 seconds]
rf has joined #ocaml
gareppa has quit [Quit: Leaving]
Serpent7776 has quit [Ping timeout: 252 seconds]
gareppa has joined #ocaml
farn has quit [Ping timeout: 255 seconds]
farn has joined #ocaml
gareppa has quit [Quit: Leaving]
rf has quit [Ping timeout: 260 seconds]
bartholin has quit [Quit: Leaving]
rf has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
waleee has joined #ocaml
bgs has quit [Remote host closed the connection]