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/
<discocaml> <elliottcable> hrm. is there a way to create a _local_ module-type in a `.mli`?
<discocaml> <elliottcable> I know I can *alias* a module that already exists at another path (`Foo := Some.Path`); but what if I need to create a temporary *entire module* that isn't then present in the exported interface?
<discocaml> <deepspacejohn> I’m not sure if I understand how that would work. Creating a “temporary” module in an interface which isn’t exposed by the interface seems like a contradiction.
<discocaml> <elliottcable> I've got a different workaround to my original problem, and what I described is probably a dangerous idea anyway for readability — but just for clarity, I'm saying something like:
<discocaml> <elliottcable> "be able to use `Foo.bar` and `Foo.baz` in `widget.mli`, without consumers seeing `Widget.Foo` existing, and without having to create `foo.mli` just for this purpose."
<discocaml> <deepspacejohn> You could define `type foo_bar = Foo.bar` in the ml and expose an abstract foo_bar in the mli.
mal`` has quit [Server closed connection]
mal`` has joined #ocaml
<companion_cube> module type of struct... end?
tom1212 has joined #ocaml
tom1212 has quit [Remote host closed the connection]
neiluj has joined #ocaml
Boarders___ has quit [Server closed connection]
Boarders___ has joined #ocaml
edr has quit [Quit: Leaving]
bartholin has joined #ocaml
waleee has quit [Ping timeout: 268 seconds]
bartholin has quit [Remote host closed the connection]
czy has joined #ocaml
czy has quit [Remote host closed the connection]
bacam has quit [Server closed connection]
bacam has joined #ocaml
Serpent7776 has joined #ocaml
Serpent7776 has quit [Ping timeout: 246 seconds]
Anarchos has joined #ocaml
adrien has quit [Server closed connection]
adrien has joined #ocaml
sixfourtwelve has joined #ocaml
sixfourtwelve has left #ocaml [#ocaml]
szkl has joined #ocaml
dnh has joined #ocaml
Ekho has quit [Server closed connection]
Ekho has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
remexre has quit [Server closed connection]
remexre has joined #ocaml
szkl has quit [Quit: Connection closed for inactivity]
ocabot has quit [Server closed connection]
ocabot has joined #ocaml
esum has quit [Server closed connection]
esum has joined #ocaml
<discocaml> <kakadu18> hey. Is there any simple explanation why we can't write a function with a type `(module M: MONAD) -> 'a M.t -> 'a M.t`
<discocaml> <kakadu18> I found explanations whey we can't return `SomeFunctor(M).t` (the type of result of a function depends on a value of the function argument)
<discocaml> <kakadu18> But in simplified case it seems that this issue doesn't appear
* discocaml <kakadu18> predicts that somewhere Yallop's encoding of higher kinded types and modular explicits will appear
szkl has joined #ocaml
<discocaml> <octachron> Types inside first-class modules are existentially quantified, `(module M: monad) -> 'a M.t` is an escaping existential.
<discocaml> <kakadu18> OK, but why. Can we construct a case, when allowing polymorphism will lead to crash?
dnh has joined #ocaml
waleee has joined #ocaml
neiluj has quit [Remote host closed the connection]
neiluj has joined #ocaml
waleee has quit [Ping timeout: 268 seconds]
neiluj has quit [Remote host closed the connection]
szkl has quit [Quit: Connection closed for inactivity]
welterde has quit [Server closed connection]
welterde has joined #ocaml
<Anarchos> I use dune to compile a lilbrary and it prefixes all the modules by Util__ which is the name of the lib. How can i get a more standard "Util." prefix ?
<companion_cube> if the library's name is `Util` then it's already the case
<Anarchos> yes my library is named util. is it a conflict with a standard name ?
<companion_cube> I'm not sure, it does sound like an extremely general name if you intend to publish it on opam
<Anarchos> it was just an little personnal utilities lib
<companion_cube> then maybe try to find a more unique name for it? :)
<Armael> independently of the name, you should get a Util. prefix?
<Armael> dune creates a util module and aliases all the util__foo modules in it, so you can do Util.Foo
<companion_cube> but the library name affects the prefix
<Armael> of course
micro has quit [Server closed connection]
micro has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
midgard has quit [Server closed connection]
midgard has joined #ocaml
bartholin has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Tuplanolla has joined #ocaml
dstein64- has joined #ocaml
dstein64- has quit [Client Quit]
dstein64- has joined #ocaml
dstein64 has quit [Ping timeout: 246 seconds]
dstein64- is now known as dstein64
<discocaml> <octachron> @kakadu18 , ? an escaping existential is just non-sensical
dnh has joined #ocaml
Serpent7776 has joined #ocaml
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<discocaml> <kakadu18> Do you wanna say, that replacement of existential quantifier by the universal one in the context of my example, will lead to unsoundness, similar to https://counterexamples.org/scope-escape.html ?
Anarchos has joined #ocaml
dnh has joined #ocaml
<discocaml> <leviroth> Perhaps a related question is why we can't have the higher-kinded version of `(module Foo with type t = 'a) -> 'a`. Clearly there's no problem with escaping here.
waleee has joined #ocaml
Geekingfrog has quit [Server closed connection]
Geekingfrog has joined #ocaml
dh` has quit [Server closed connection]
<discocaml> <octachron> Replacing the existential quantifier on M.t by universally one would indeed directly gives you a proof of false as a one-liner.
<discocaml> <kakadu18> I have difficultuies with extending Curry-Howard isomarphism in the presence of type operators....
<discocaml> <kakadu18> It would OK, if someone would point to a recommended reading about this. (Ideally, finishable during Sunday). (Writing very long messages in Discord could be painful.) I case of questions I will return to this next week
<discocaml> <kakadu18> It would be OK, if someone would point to a recommended reading about this. (Ideally, finishable during Sunday). (Writing very long messages in Discord could be painful.) I case of questions I will return to this next week
<discocaml> <kakadu18> It would be OK, if someone would point to a recommended reading about this. (Ideally, finishable during Sunday). (Writing very long messages in Discord could be painful.) In case of questions I will return to this next week
<discocaml> <octachron> @leviroth, as far as I imperfectly understand, the current implement mostly work because replacing a zero-artiy type constructor can be done with a hack: the type of the module `M with type t = a` can , be edited on the fly to replace `t` by the type `a`, and then harmonizing the internal and external view only requires substituting a type variable, rather than trying to rewrite type digraphs.
xenu has quit [Server closed connection]
xenu has joined #ocaml
Serpent7776 has quit [Ping timeout: 246 seconds]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<discocaml> <kakadu18> I thought a little bit about this, and maybe it is more obvious than I thought. If we can type-check something to `forall a . (M: sig type 'a t end) -> 'a M.t` than it should have questionable semantics for modules like `struct type _ t = I : int t | F: float t`. The same problems arise, when we want to return a GADT value from parser (we need to pack it to make it compilable).
<discocaml> <kakadu18> This intuition raises questions why the PR about modular explicits makes sense, but I will leave it for a new day...
<discocaml> <._null._> What's problematic here ?
<discocaml> <._null._> @kakadu18 What's problematic here ?
bartholin has quit [Quit: Leaving]
<Anarchos> kakadu18 did you find a good link to curry howard ?
dnh has joined #ocaml
dnh has quit [Ping timeout: 256 seconds]
<discocaml> <gooby_clown> When OCaml gets unboxed types will we get int64, int32 etc as separate types?
Anarchos has quit [Quit: Vision[]: i've been blurred!]
<companion_cube> They're already there, just not inboxed