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/
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
waleee has quit [Ping timeout: 245 seconds]
chrisz has quit [Ping timeout: 255 seconds]
chrisz has joined #ocaml
alphacentauri has quit [Quit: WeeChat 4.0.5]
alphacentauri has joined #ocaml
TrillionEuroNote has quit [Ping timeout: 264 seconds]
TrillionEuroNote has joined #ocaml
Serpent7776 has joined #ocaml
mro has joined #ocaml
thenameisme has joined #ocaml
Ella has quit [Quit: The Lounge - https://thelounge.chat]
Ella has joined #ocaml
bartholin has joined #ocaml
thenameisme has quit [Quit: Quit]
azimut has quit [Ping timeout: 252 seconds]
ec has quit [Ping timeout: 252 seconds]
jlrnick has joined #ocaml
ec has joined #ocaml
azimut has joined #ocaml
Geekingfrog_ has joined #ocaml
Geekingfrog has quit [Ping timeout: 255 seconds]
Geekingfrog_ is now known as Geekingfrog
bartholin has quit [Quit: Leaving]
dnh has joined #ocaml
azimut has quit [Ping timeout: 252 seconds]
wingsorc has quit [Quit: Leaving]
jlrnick has quit [Ping timeout: 260 seconds]
kurfen has quit [Read error: Connection reset by peer]
kurfen has joined #ocaml
<discocaml> <cswine> why are effects so good?
alphacentauri has quit [Quit: WeeChat 4.0.5]
<companion_cube> Because the contributors are awesome
<discocaml> <cswine> sounds about right
<discocaml> <cswine> btw are there books on ocaml 5? maybe ones in progress?
<companion_cube> No idea but that's a good question. Maybe it needs to wait a bit until we get some stable libraries in the ecosystem...
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
ec has quit [Read error: Connection reset by peer]
ec has joined #ocaml
<octachron> A stable syntax would be a good start too.
pandeyan has quit [Quit: ZNC 1.8.2 - https://znc.in]
anpad has joined #ocaml
BenceF has joined #ocaml
<BenceF> Does somebody know a js_of_ocaml (or reason/rescript) project that uses menhir?
alphacentauri has joined #ocaml
jlrnick has joined #ocaml
jlrnick has quit [Ping timeout: 255 seconds]
BenceF has quit [Ping timeout: 264 seconds]
waleee has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
bartholin has joined #ocaml
mro has quit [Quit: Leaving]
<Leonidas> How do I instantiate a functorized module type in a module signature?
waleee has quit [Ping timeout: 272 seconds]
<Leonidas> I used to have `include FOO` but now FOO is a functor module type, but `include FOO(M)` seems to be a syntax error
alphacentauri has quit [Quit: WeeChat 4.0.5]
<discocaml> <Kali> try `include module type of ...`
alphacentauri has joined #ocaml
<Leonidas> Unbound module FOO Hit: Hint: There is a module type named S.CONTEXT, but module types are not modules
<Leonidas> Unbound module FOO Hint: There is a module type named FOO, but module types are not modules
<Leonidas> it seems like it is missing the application
<discocaml> <Kali> hm..
<discocaml> <Kali> oh, wait, of course; it is impossible to apply functorized type signatures just as it is impossible to apply function types to other types
<discocaml> <Kali> what you can do is instantiate an actual module with that signature and recover the signature with `module type of`
<discocaml> <Kali> let me write an example
<Leonidas> I thought about doing `include module type of struct include FOO(M) end` but that doesn't work, so yeah, an example would be very helpful
<discocaml> <Kali> module Test(M:sig type t val x : t end) = struct
<discocaml> <Kali> include M
<discocaml> <Kali> end
<discocaml> <Kali>
<discocaml> <Kali> module Test2 = struct
<discocaml> <Kali> type t = int
<discocaml> <Kali> let x = 1
<discocaml> <Kali> end
<discocaml> <Kali>
<discocaml> <Kali> module type Test3 = sig
<discocaml> <Kali> include module type of Test(Test2)
<discocaml> <Kali> end
<discocaml> <Kali> ```
<discocaml> <Kali> oops, sorry about the bad formatting
<discocaml> <bnguyenv> You can create a functor that will return the correct module type as its sole component, and actually use that in your functor definition to constrain the return signature too.
<discocaml> <Kali> wait, yes, this is a better idea
<discocaml> <bnguyenv> Like `module F (A : ...) (B : ...) : sig module type S = sig type t = A.t ... end end`
<discocaml> <bnguyenv> oops `struct` for the body of `F` of course
<discocaml> <bnguyenv> (credits to octachron for this pattern)
<Leonidas> Ok, need to see whether and how I can change my code, because that does look nice
nore has quit [Ping timeout: 245 seconds]
alphacentauri has quit [Quit: WeeChat 4.0.5]
azimut has joined #ocaml
alphacentauri has joined #ocaml
John_Ivan__ has quit [Quit: Disrupting the dragon's slumber one time too often shall eventually bestow upon all an empirical and indiscriminate conflagration that will last for all goddamn eternity.]
John_Ivan has joined #ocaml
<Leonidas> Kali: I think your solution doesn't work for me because in your example the modules are modules, in my codebase they would be functor arguments
<Leonidas> I am unsure whether that functor application would even generate compatible types
<Leonidas> but it seems like if I make both C and M functor arguments, I can do `include module type of C(M)` which at least compiles :-)
ursa-major has joined #ocaml
dh` has quit [Ping timeout: 255 seconds]
dh` has joined #ocaml
dh` has quit [Ping timeout: 252 seconds]
dh` has joined #ocaml
Tuplanolla has joined #ocaml
ursa-major has quit [Quit: WeeChat 4.0.5]
waleee has joined #ocaml
<Leonidas> Another odd problem (I would google it but not sure what to even google for). I have a `include module type of C(M)` in my signature and `C(M).t` is just an abstract type. In my implementation it's a record. Before I functorized C it worked and picked up that `t` is abstract but not anymore.
<Leonidas> Type declarations do not match: type t = Dir_context(M)(C).t = { ... } is not included in type t = C(M).t The type t is not equal to the type C(M).t
<Leonidas> Maybe the fact that C(M).t is abstract because it lost the information when I asked for `module type of C(M)`?
Serpent7776 has quit [Ping timeout: 258 seconds]
<discocaml> <usdt0865> I will help you how to earn $40k or more within 72hours from the Crypto Market, but you’ll pay me a 10% of your profit when you receive it.
<discocaml> <usdt0865> If interested, send me a direct message. For more information…contact via 👇
<discocaml> <usdt0865>
<discocaml> <usdt0865> WhatsApp; +1 (714) 464-0418
<discocaml> <usdt0865>
<discocaml> <usdt0865> https://t.me/Mark_Wilson01
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<technomancy> lmao cool
<discocaml> <Kali> so true
<discocaml> <Kali> @admin
bartholin has quit [Quit: Leaving]
dnh has joined #ocaml
<src> $40k would be pretty cool right now
<src> hey guys, I already made my first $5k, number above totally legit lol
<src> (jk)
Tuplanolla has quit [Quit: Leaving.]
masterbuilder has quit [Read error: Connection reset by peer]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]