companion_cube changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml 4.11 release notes: https://caml.inria.fr/pub/distrib/ocaml-4.11/notes/Changes | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
mxns has joined #ocaml
hackinghorn has joined #ocaml
<hackinghorn> hi
Haudegen has quit [Ping timeout: 240 seconds]
mxns has quit [Ping timeout: 245 seconds]
<d_bot> <tnkhanh> ha
<d_bot> <tnkhanh> I just installed merlin but then I exited, I missed the vim setup instruction
mxns has joined #ocaml
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
mxns has quit [Ping timeout: 250 seconds]
mxns has joined #ocaml
infinigon has quit [Ping timeout: 245 seconds]
mxns has quit [Ping timeout: 240 seconds]
infinigon has joined #ocaml
rock64 has quit [Ping timeout: 252 seconds]
rock64 has joined #ocaml
arecaceae has quit [Remote host closed the connection]
arecaceae has joined #ocaml
rwmjones has quit [Ping timeout: 248 seconds]
rwmjones has joined #ocaml
nfc has quit [Quit: WeeChat 2.9]
mxns has joined #ocaml
mxns has quit [Ping timeout: 250 seconds]
zebrag has quit [Quit: Konversation terminated!]
zebrag has joined #ocaml
hackinghorn has quit [Ping timeout: 246 seconds]
borne has quit [Ping timeout: 250 seconds]
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
mxns has joined #ocaml
andreas31 has quit [Ping timeout: 240 seconds]
andreas31 has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
infinigon_ has joined #ocaml
infinigon has quit [Ping timeout: 268 seconds]
zebrag has quit [Quit: Konversation terminated!]
curtosis has joined #ocaml
mxns has joined #ocaml
vicfred has quit [Quit: Leaving]
vicfred has joined #ocaml
mxns has quit [Ping timeout: 250 seconds]
<d_bot> <tnkhanh> I'm trying to see it by installing on another machine
curtosis has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
decentpenguin has quit [Ping timeout: 246 seconds]
decentpenguin has joined #ocaml
hosewiejacke has joined #ocaml
narimiran has joined #ocaml
vicfred has quit [Quit: Leaving]
vsiles_ is now known as vsiles
mfp has joined #ocaml
waleee-cl has quit [Quit: Connection closed for inactivity]
shawnw has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #ocaml
Serpent7776 has quit [Read error: Connection reset by peer]
Serpent7776 has joined #ocaml
borne has joined #ocaml
borne has quit [Ping timeout: 246 seconds]
borne has joined #ocaml
Haudegen has joined #ocaml
bartholin has joined #ocaml
hosewiejacke has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 240 seconds]
hosewiejacke has joined #ocaml
<d_bot> <joris> Hi, i have a mapping type a bit like this :
<d_bot> <joris>
<d_bot> <joris> ```ocaml
<d_bot> <joris> type 'a t = { mapping : (string, string) Hashtbl.t } constraint 'a = [> ]
<d_bot> <joris>
<d_bot> <joris> let setup () : [> `Bar ] t = assert false
<d_bot> <joris> ```
<d_bot> <joris> So the setup fonction returns a fresh mapping with the proper phantom type 'a, but 'a is properly opened. Then it is unified with usage.
<d_bot> <joris> The issue is that, each usage of mapping has a concrete 'a type, so i cannot build a single mapping obviously. but mapping is costly to construct, so ideally i would like to have a mapping factory, that can generate a fresh instance using the same underlying data.
<d_bot> <joris> I would have thought it is simple to do but for some reason i'm struggling to make it work
<d_bot> <froyo> what's your application like (concretely)?
<d_bot> <froyo> if it's the same underlying data, have you considered making the mapping a ref?
<d_bot> <froyo> have you considered instantiating the mapping separately then composing it with the tag on setup?
<d_bot> <joris> the phantom type is infered during the mapping construction (like i have some bind_function that widen the phantom type each time you add a binding), so essentially the construction is tangled with the type construction
<d_bot> <joris> and this is the main issue, because i don't think there is any way to write a function
<d_bot> <joris> ``` val fresh : 'a t -> 'b t constraint 'b :> 'a ``` in pseudo ocaml
<d_bot> <joris> i guess it is always the same problem with row variable 😦
<d_bot> <joris> > if it's the same underlying data, have you considered making the mapping a ref?
<d_bot> <joris> my problem is not at runtime but at type level, i need to generate fresh type instance without reconstructing the type
<d_bot> <octachron> It half sounds like you simply want to discard the phantom type with `val magic: 'a t -> 'b t` ?
<d_bot> <joris> yes, but i want to keep the constraint if ```'a = [> `Foo | `Bar ] ```, then ```[> `Foo | `Bar] ``` but not 'a = 'b
<d_bot> <joris> but i think this is impossible in ocaml type system
<d_bot> <octachron> And if the type is generalized, I am not sure what is the issue with fresh type instance?
<d_bot> <joris> it is too generalized. The concrete usecase is that this encodes environement of some expression. So constructing the mapping adds open constraints, but using the mapping adds subtyping constraints. If i use a single mapping instance, it generalizes to the biggest subtyping constraint, which is not what i want
<d_bot> <joris> the mapping is consume with functions like ```val make_expr : mapping:[< `f1 | `f2 t ] -> [> 'f2 | F2] t -> ...```
<d_bot> <joris> creating one mapping per "usecase" works well, but it is starting to consume a lot of memory 🙈
<d_bot> <joris> maybe the solution is that i implement some hashconsing or whatever so runtime is not deduplicated
<d_bot> <octachron> You can use conversion function as a simili-proof of subtyping:
<d_bot> <octachron> ```ocaml
<d_bot> <octachron> type +'a meta
<d_bot> <octachron> val conv: ('a meta -> 'b meta) -> 'a t -> 'b t
<d_bot> <octachron> ```
<d_bot> <octachron> But your issue of generalization to the biggest_subtyping constraint sounds strange.
<d_bot> <octachron> If the type of the mapping is polymorphic, the constraint should not be shared.
<d_bot> <octachron> If you have a function argument that should be used in differenct context, you could duplicate the argument.
<d_bot> <joris> hm let me see about this
mxns has joined #ocaml
<d_bot> <froyo> \* subscribes to this thread *
mxns has quit [Ping timeout: 245 seconds]
<d_bot> <joris> Yes I do that already but the problem is building 'global mapping' reused a cross multiple functions
<d_bot> <octachron> Are you exporting the phantom parameter as invariant or contravariant?
mro_name has joined #ocaml
<d_bot> <joris> invariant for now
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 252 seconds]
richbridger has quit [Remote host closed the connection]
mxns has joined #ocaml
<d_bot> <octachron> So `setup ()` generate a weakly polymorphic variant. In this case, you cannot unshare it. Maybe you can store type partial type in a different parameter of your type in your builder function and use those types to create a partial view. Note that I am not sure if such row type based producer/consumer API open-ended row based producer/consumer can work well.
<d_bot> <joris> it kind of works, but it totally brings merlin to its knees 😄
<d_bot> <joris> once modules gets big enough, merlin just does not work anymore, 100% cpu in typechecker to compare polyvars types
mro_name has quit [Remote host closed the connection]
<d_bot> <joris> but currently it works well enough and it is used already by thousand of loc
<d_bot> <joris> just trying to improve it
<d_bot> <octachron> My experience is that merlin works fine with module that takes a dozen of minutes to typecheck? Evven, if you do learn to be parsimonious with typechecking in those cases.
<d_bot> <joris> ocamllsp at least is not async apparently and is processing in order, so it stalls everything, with errors displayed from 30s ago when you typed
<d_bot> <joris> awful experience, but it's ok forces me to keep modules under 1000lines
<d_bot> <froyo> btw people at discuss.ocaml.org / the mailing list could benefit from your little adventure i think @joris
<d_bot> <joris> ```ocaml
<d_bot> <joris> let group_key =
<d_bot> <joris> Sql2.apply_expr [%expr "@key_field = @key "] ~key_field:group_by
<d_bot> <joris> ~key:(Sql2.uint (Unsigned.UInt64.of_int64 key))
<d_bot> <joris> in
<d_bot> <joris> let target = make_target filter_target target in
<d_bot> <joris> let where = Sql2.apply_expr [%expr "@where AND @group_key"] ~where ~group_key in
<d_bot> <joris> let where =
<d_bot> <joris> match group_witness with
<d_bot> <joris> | None -> where
<d_bot> <joris> | Some group_witness ->
<d_bot> <joris> Sql2.apply_expr [%expr "@where AND link_id != @group_witness"] ~where ~group_witness
<d_bot> <joris> in
<d_bot> <joris> ```
<d_bot> <joris> fwiw the end code looks like this, so even if internally it is scary, the end result looks ok i think
mro_name has joined #ocaml
<d_bot> <joris> well, except for the fact that ocaml compiler does quite a bad job at diffing polyvars on type errors
<d_bot> <octachron> Is the issue that you have humongous types and the typechecker is acting like a human can diff few dozen tags on the fly? Or is that something else?
<d_bot> <joris> no, this. And it is more few hundred tags
<d_bot> <joris> also sometimes it prints diff, but my types are in the form ``` `Field_name of < null : `Null; typ : int > ```
mro_name has quit [Remote host closed the connection]
<d_bot> <joris> and the typecheck helfully computes the diff by saying "the types are incompatibles, method null differs : expect ````Null, got `NotNull ``` "
<d_bot> <joris> but it does not say which of the hundred of variant it is that has wrong null method 😄
<d_bot> <joris> and then i'm like cool story bro
<d_bot> <octachron> Ok, that part of the error reporting might be improvable (without too much effort), and it happens with "ordinary" types.
<d_bot> <joris> i probably should have a look
mxns has quit [Ping timeout: 246 seconds]
mro_name has joined #ocaml
schlaftier has joined #ocaml
<d_bot> <bikal> I am trying to create a http form decoder via gadt but am getting a very unfamiliar error message.
<d_bot> <bikal> ```
<d_bot> <bikal> File "gadt1.ml", line 53, characters 25-29:
<d_bot> <bikal> 53 | loop { fields; ctor } errors)
<d_bot> <bikal>
<d_bot> <bikal> Error: This expression has type ctor = $0 -> $1
<d_bot> <bikal> but an expression was expected of type $1
<d_bot> <bikal> Type $0 -> $1 is not compatible with type $
<d_bot> <bikal>
<d_bot> <bikal> ```
<d_bot> <bikal> Any gadt expert in here?
mro_name has quit [Ping timeout: 245 seconds]
<d_bot> <joris> The dollar type variables are existential inside the gadt
<d_bot> <joris> Basically it tells you you are passing a function while it expects a value of the type of the return type of your function. You probably forgot an argument
<d_bot> <bikal> yes, but in that branch (line 52) there is no v since decoding is an error.
<d_bot> <bikal> ah, I think I just got it.
<d_bot> <bikal> 🤦‍♂️
<d_bot> <bikal> sigh... tried to use record update but same error
oriba has joined #ocaml
zebrag has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
<d_bot> <octachron> @bikal : The existential types are a minor detail here: in the error case, you are removing a field from the `fields` list without removing an argument from the `ctor` function.
<d_bot> <octachron> The simplest fix seems to abort the application after the first error.
mro_name has joined #ocaml
mro_name has quit [Remote host closed the connection]
<d_bot> <bikal> thanks. yes, I am realizing that too. Perhaps I need to separate record construction from validation ...
shawnw has quit [Ping timeout: 240 seconds]
hosewiejacke has quit [Ping timeout: 268 seconds]
hosewiejacke has joined #ocaml
mxns has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
mxns has joined #ocaml
mro_name has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
freshmaker666 is now known as greeb
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
waleee-cl has joined #ocaml
mxns has joined #ocaml
shawnw has joined #ocaml
borne has quit [Ping timeout: 246 seconds]
borne has joined #ocaml
shawnw has quit [Ping timeout: 240 seconds]
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
hosewiejacke has quit [Ping timeout: 240 seconds]
Haudegen has joined #ocaml
hosewiejacke has joined #ocaml
mro_name has quit [Remote host closed the connection]
borne has quit [Ping timeout: 240 seconds]
mro_name has joined #ocaml
andreas31 has quit [Ping timeout: 240 seconds]
andreas31 has joined #ocaml
hosewiejacke has quit [Ping timeout: 240 seconds]
Tuplanolla has joined #ocaml
hosewiejacke has joined #ocaml
borne has joined #ocaml
SrPx has quit [Ping timeout: 276 seconds]
kakadu has joined #ocaml
SrPx has joined #ocaml
vicfred has joined #ocaml
Mahak has joined #ocaml
hosewiejacke has quit [Ping timeout: 268 seconds]
andreas31 has quit [Ping timeout: 240 seconds]
andreas31 has joined #ocaml
hosewiejacke has joined #ocaml
hosewiejacke has quit [Client Quit]
SomyaSrivastava has joined #ocaml
borne has quit [Ping timeout: 245 seconds]
mro_name has quit [Remote host closed the connection]
Jyoti_Balodhi has joined #ocaml
priyanka has joined #ocaml
priyanka has quit [Client Quit]
Haudegen has quit [Quit: Bin weg.]
mro_name has joined #ocaml
mro_name has quit [Remote host closed the connection]
Jyoti_Balodhi has quit [Ping timeout: 240 seconds]
mxns has quit [Ping timeout: 252 seconds]
mxns has joined #ocaml
priyanka has joined #ocaml
<priyanka> Hello everyone,My name is priyanka. My initial application got approved for outreachy.I want to contribute to ocaml. I am interested in this project - Improve the ocaml.org website.
EricRucker has joined #ocaml
priyanka has quit [Quit: Connection closed]
<Mahak> Hi everyone!
<Mahak> I'm Mahak from India and I'm very excited to say that my initial application is approved.
<Mahak> I'm interested in 2 projects which are "Improve the Ocaml.org website" and "Add templating to the OCaml documentation generator".
<Mahak> I saw good first issues on the GitHub but they are mostly assigned or some work is going on.
<Mahak> I'm looking forward to contribute under OCaml organization
<Mahak> Thank you :)
EricRucker is now known as EricR
priyanka has joined #ocaml
<octachron> Beware that I don't know if the Outreachy mentors are on irc this year.
<priyanka> okay..thanks for informing
<Mahak> octachron
<Mahak> Should we communication via mail with our mentors ?
priyanka has quit [Client Quit]
priyanka has joined #ocaml
<octachron> I have seen the most activity on discuss.ocaml.org and the issue page of ocaml.org: https://github.com/ocaml/ocaml.org/issues/1245
priyanka has quit [Client Quit]
priyanka65 has joined #ocaml
<d_bot> <craigfe> @patricoferris may be around here, but I don't know if it's a convenient channel for him.
<Mahak> Yeah!
<Mahak> Thanks octachron :)
priyanka65 has quit [Client Quit]
bartholin has quit [Quit: Leaving]
webshinra_ has quit [Remote host closed the connection]
Jesin has quit [Quit: Leaving]
webshinra has joined #ocaml
EricR has quit [Quit: Connection closed]
<d_bot> <patricoferris> Hi Mahak, thanks for wanting to contribute. Feel free to ping me on here if you have questions (I check it daily so it's a good place to do so). Bare in mind that currently there are lots of people interested and I've seen Outreachy comments on this discord server, issues on Github, discuss.ocaml.org, in my personal email etc. so managing that flood of people is challenging and takes a little time to get around to everyone
mro_name has joined #ocaml
<Mahak> Sure @patricoferris :)
mro_name has quit [Ping timeout: 240 seconds]
tane has joined #ocaml
vicfred has quit [Quit: Leaving]
curtosis has joined #ocaml
vicfred has joined #ocaml
Haudegen has joined #ocaml
Chitvan has joined #ocaml
<Chitvan> hello everyone
Chitvan33 has joined #ocaml
Chitvan has quit [Quit: Connection closed]
Chitvan has joined #ocaml
Chitvan33 has quit [Client Quit]
<Chitvan> hi @patricoferris
oriba has joined #ocaml
kakadu has quit [Remote host closed the connection]
<d_bot> <gar> How can I build a pack module where the deps are interdependent? If I add -for-pack, I get `Foo.cmx` is not a compilation unit description. If I omit -for-pack, I get `Foo.cmx` was not compiled with the `-for-pack` option. The documentation, as usual, is effectively useless.
mxns has quit [Ping timeout: 276 seconds]
Chitvan has quit [Quit: Connection closed]
delysin has quit [Quit: WeeChat 3.1]
mxns has joined #ocaml
delysin has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
mxns has joined #ocaml
narimiran has quit [Ping timeout: 240 seconds]
ijeomaemeruwa has joined #ocaml
<ijeomaemeruwa> Hello, I'm Ijeoma Emeruwa from Nigeria. Excited to contribute to the ocaml.org project
<d_bot> <froyo> o/
prahitha has joined #ocaml
richbridger has joined #ocaml
Mahak has quit [Quit: Connection closed]
ijeomaemeruwa has quit [Ping timeout: 240 seconds]
blah has joined #ocaml
curtosis is now known as curtosis[away]
curtosis[away] has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
dldisha has joined #ocaml
borne has joined #ocaml
dldisha has quit [Client Quit]
prahitha has quit [Quit: Connection closed]
dldisha has joined #ocaml
dldisha has left #ocaml [#ocaml]
tane has quit [Quit: Leaving]
dldisha has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
<dldisha> Hello everyone, I'm Disha. I'm from India. My initial Outreachy application got approved. Looking forward to contributing and learning.
<d_bot> <froyo> so many new faces, i hope all of you have fun -- and many stay an active part of the ocaml community <3
mxns has joined #ocaml
<blah> Hello everyone, you can call me Blah. Its so nice to be here, I am an Outreachy applicant and I wish to learn and contribute into this project.
mxns has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
CarolVilarino has joined #ocaml
vicfred has quit [Quit: Leaving]
mxns has quit [Quit: ZNC 1.8.2 - https://znc.in]
mxns has joined #ocaml
dldisha has quit [Ping timeout: 240 seconds]
mxns has quit [Ping timeout: 246 seconds]
borne has quit [Ping timeout: 276 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 245 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 260 seconds]
mxns has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
mxns has quit [Ping timeout: 268 seconds]
mxns has joined #ocaml
vicfred has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
mxns has joined #ocaml