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.]
waleee has quit [Ping timeout: 240 seconds]
rak has quit [Server closed connection]
rak has joined #ocaml
chrisz_ has joined #ocaml
chrisz has quit [Ping timeout: 255 seconds]
azimut has quit [Ping timeout: 240 seconds]
justache has quit [Server closed connection]
justache has joined #ocaml
Serpent7776 has joined #ocaml
bartholin has joined #ocaml
dhil has joined #ocaml
<discocaml> <darrenldl> is Thread the cheapest way to get lightweight preemption in ocaml 5?
<discocaml> <octachron> Yes as far as I know.
Techcable has joined #ocaml
bartholin has quit [Quit: Leaving]
waleee has joined #ocaml
spip has joined #ocaml
<discocaml> <xavierm02> Given the definition of mutually recursive types, what is the simplest way of obtaining a function that interprets them in an arbitrary way (i.e. maps each constructor to a function, and evaluates the result)?
<discocaml> <xavierm02> I tried building the function in a somewhat modular way by defining each type on its own by making it polymorphic over the other to-be-defined types, but when I combine the definitions, I get an error saying that the definition is cyclic. I then tried taking the to-be-defined types as an argument to a functor, and to then use a recursive module to combine them together. This seems to work, but I'm not entirely happy with it because I need to
<discocaml> <bnguyenv> I think you just need to write `type thing = Thing of other Thing.t and other = thing Other.t` with a constructor.
<discocaml> <bnguyenv> For the first version to work.
<discocaml> <darrenldl> @octachron thanks!
wingsorc has quit [Ping timeout: 240 seconds]
EmmaBonestell has quit [Ping timeout: 268 seconds]
waleee has quit [Remote host closed the connection]
waleee has joined #ocaml
<discocaml> <xavierm02> @bnguyenv Hm. I'd prefer a solution that doesn't add a superfluous constructor that wasn't there in the initial mutually recursive definition. But this looks far more reasonable than my attempts with recursive modules, and if I can always [@@unboxed] the types. Thanks!
azimut has joined #ocaml
GreaseMonkey has quit [Quit: HYDRA IRC LOL]
<discocaml> <froyo> why not do the simple thing? https://pastebin.com/NSbbYcak
Putonlalla has quit [Server closed connection]
Putonlalla has joined #ocaml
greaser|q has joined #ocaml
greaser|q has quit [Client Quit]
greaser|q has joined #ocaml
<discocaml> <xavierm02> I wanted to be a bit more modular. The two inductives are like a normal calculus (ints, addition, ...) and a somewhat orthogonal module-like system, and there is a priori no reason for them to be this tightly coupled.
Serpent7776 has quit [Ping timeout: 268 seconds]
bartholin has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
waleee has joined #ocaml
waleee has quit [Ping timeout: 258 seconds]
Tuplanolla has joined #ocaml
dhil has quit [Quit: Leaving]
waleee has joined #ocaml
Serpent7776 has joined #ocaml
wingsorc__ has joined #ocaml
<discocaml> <Et7f3 (@me on reply)> Yay #github-ocaml-feedwe have all github repos 🙂
greaser|q has quit [Changing host]
greaser|q has joined #ocaml
greaser|q is now known as GreaseMonkey
gentauro has quit [Ping timeout: 240 seconds]
Serpent7776 has quit [Ping timeout: 240 seconds]
gentauro has joined #ocaml
ds-ac has quit [Ping timeout: 265 seconds]
szkl has joined #ocaml
bgs has quit [Remote host closed the connection]
bartholin has quit [Quit: Leaving]
SquidDev has quit [Server closed connection]
SquidDev has joined #ocaml
wingsorc__ has quit [Ping timeout: 258 seconds]
<discocaml> <functionalprogramming> why does this print "what324"
<discocaml> <functionalprogramming> instead of "what243"
<companion_cube> Did you print something else before, and did not flush the formatter?
<companion_cube> It's all buffered
<discocaml> <functionalprogramming> i am also experimenting with flush now but I don't think it's doing what I think it's doing
<discocaml> <functionalprogramming> this prints nothing
<discocaml> <functionalprogramming> I did not print anything before I printed "what" in the first screenshot
Tuplanolla has quit [Quit: Leaving.]
<discocaml> <darrenldl> have you flushed stdout after flushing formatter?
<discocaml> <functionalprogramming> ohhh
<discocaml> <darrenldl> its typically easier to just do everything w.r.t. formatter in the format string as well
<discocaml> <functionalprogramming> nothing happens even if i also do `let () = flush stdout` at the end
<discocaml> <functionalprogramming> yeahh im not sure the right way to approach this and I can't find any examples online either
<discocaml> <darrenldl> can you show the full code?
<discocaml> <functionalprogramming> I'm using containers
<discocaml> <functionalprogramming> or um just playing around with it i guess
<discocaml> <functionalprogramming> i am yak shaving rn 😄
<discocaml> <darrenldl> how are you running it? also lets move to #beginners
<discocaml> <functionalprogramming> ohhh i thought i was in #beginners
<discocaml> <functionalprogramming> sorry
waleee has quit [Ping timeout: 258 seconds]
waleee has joined #ocaml