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/
Stumpfenstiel has quit [Ping timeout: 276 seconds]
Serpent7776 has quit [Ping timeout: 276 seconds]
Haudegen has quit [Ping timeout: 246 seconds]
rf_ has quit [Ping timeout: 276 seconds]
waleee has quit [Ping timeout: 265 seconds]
rf has joined #ocaml
chrisz has quit [Ping timeout: 268 seconds]
chrisz has joined #ocaml
wingsorc__ has quit [Quit: Leaving]
wingsorc has joined #ocaml
rf has quit [Ping timeout: 276 seconds]
spip has quit [Quit: Konversation terminated!]
root2 is now known as Myrl-saki
azimut_ has joined #ocaml
azimut has quit [Ping timeout: 255 seconds]
trillion_exabyte has quit [Ping timeout: 248 seconds]
trillion_exabyte has joined #ocaml
trev has joined #ocaml
bartholin has joined #ocaml
xd1le has joined #ocaml
williewillus has quit [Ping timeout: 246 seconds]
Tuplanolla has joined #ocaml
Serpent7776 has joined #ocaml
olle has joined #ocaml
Haudegen has joined #ocaml
xgqt has quit [Ping timeout: 276 seconds]
xgqt has joined #ocaml
spip has joined #ocaml
bgs has joined #ocaml
<discocaml> <lukstafi> Branching from the "why OCaml not prominent in ML" and "friendly for newbies" topics, it's impossible in OCaml to have https://jax.readthedocs.io/en/latest/pytrees.html arbitrary ADT type traversal -- and maybe possible in Haskell (higher rank functions).
<discocaml> <lukstafi> I wouldn't necessarily want it in OCaml, but it's a language design tradeoff.
<discocaml> <octachron> Higher-rank functions are supported in OCaml ?
<discocaml> <lukstafi> But, I bet it's not too hard to write `[@@deriving pytree]`...
<discocaml> <lukstafi> Do you mean functors?
<discocaml> <octachron> Higher-rank -> Higher-rank polymorphism
<discocaml> <octachron> It sounds like you meant higher-kinded polymorphism?
<discocaml> <lukstafi> Yes probably.
<discocaml> <octachron> (which are supported through functors, even if the translation Haskell-OCaml does not work really well in term of design)
xd1le has quit [Quit: xd1le]
<discocaml> <lukstafi> OK, pytree-like functionality can be easily implemented in OCaml by analogy to `sexp`. I think that's good enough.
waleee has joined #ocaml
<neiluj> h0rror: wow, you already got a response to your discourse thread! :)
waleee has quit [Ping timeout: 246 seconds]
noonien7 has joined #ocaml
bgs has quit [Remote host closed the connection]
count3rmeasure has joined #ocaml
Everything has joined #ocaml
<h0rror> neiluj: the efficiency surprised me too, good tip to post there :)
Serpent7776 has quit [Ping timeout: 276 seconds]
Stumpfenstiel has joined #ocaml
<neiluj> probably should also post my questions on discourse for future reference too
<neiluj> guess the irc chat history is indexed somewhere
rf has joined #ocaml
olle has quit [Ping timeout: 250 seconds]
olle has joined #ocaml
count3rmeasure has quit [Ping timeout: 255 seconds]
count3rmeasure has joined #ocaml
wingsorc__ has joined #ocaml
wingsorc has quit [Remote host closed the connection]
<companion_cube> !logs
oriba has joined #ocaml
waleee has joined #ocaml
Everything has quit [Remote host closed the connection]
Serpent7776 has joined #ocaml
<discocaml> <capitalsigma> how can i have a functor that takes a parameterized module type? i.e.: i have:
<discocaml> <capitalsigma>
<discocaml> <capitalsigma> ```
<discocaml> <capitalsigma> module type PropertyTranslatorType = functor (FromType: SyntaxInstanceType) (ToType: SyntaxInstanceType) -> sig
<discocaml> <capitalsigma> module FromType = FromType
<discocaml> <capitalsigma> module ToType = ToType
<discocaml> <capitalsigma> val translateProperty: FromType.Property.t -> ToType.Property.t
<discocaml> <capitalsigma> end
<discocaml> <capitalsigma> ```
<discocaml> <capitalsigma>
<discocaml> <capitalsigma> and i want to have another module that is parameterized on instances of `PropertyTranslatorType` for any `FromType`/`ToType`. i tried:
<discocaml> <capitalsigma> ```
<discocaml> <capitalsigma> module TranslatorFunc = functor (FromType: SyntaxInstanceType) (ToType: SyntaxInstnaceType) -> functor
<discocaml> <capitalsigma> (PropertyTranslator: PropertyTranslatorType(FromType)(ToType)) ->
<discocaml> <capitalsigma> include PropertyTranslator
<discocaml> <capitalsigma> ...
<discocaml> <capitalsigma> end
<discocaml> <capitalsigma> ```
<discocaml> <capitalsigma>
<discocaml> <capitalsigma> but the syntax is not correct
<olle> Moo
<neiluj> geoff: here is how I generated the ctypes modules from a C header file: https://github.com/jtcoolen/ocaml-pari
<neiluj> (look for stubs_generation and src/dune)
bgs has joined #ocaml
<discocaml> <octachron> @capitalsigma : PropertyTranslatorType is not a parametrized module type, it is the module type of a functor.
<discocaml> <Kali> `Instance` seems to be misspelled as `Instnace`, for one
<discocaml> <Kali> in `SyntaxInstanceType`
<discocaml> <octachron> You can use either `with` constraint on the body module type or functors defining module types.
<discocaml> <octachron> `module TranslatorFunc(From_type: ...)(To_type: ...)(Property_translator: Property_translator_type with module To_type := To_type and module From_type := From_type) = ...`
<discocaml> <capitalsigma> @octachron thanks!
olle has quit [Ping timeout: 264 seconds]
gwizon has joined #ocaml
neiluj has quit [Quit: WeeChat 3.7.1]
trev has quit [Remote host closed the connection]
count3rmeasure has quit [Quit: Leaving]
<discocaml> <geoff> neiluj: thanks, I'll add that to my list and give it a go the next time I'm starting a binding project 🙏
bgs has quit [Remote host closed the connection]
Tuplanolla has quit [Quit: Leaving.]
Serpent7776 has quit [Ping timeout: 268 seconds]
Stumpfenstiel has quit [Ping timeout: 268 seconds]
bartholin has quit [Quit: Leaving]
Haudegen has quit [Ping timeout: 248 seconds]
rf has quit [Ping timeout: 240 seconds]
rf has joined #ocaml
gwizon has quit [Quit: Lost terminal]