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/
<dh`> is there a clean prefab solution for maps from simple enumerations? (particularly when you know you want it to always have a value for each constructor in the enum?)
<dh`> you can obviously use Map but it seems unnecessarily cumbersome
<dh`> and it can't enforce completeness (a value always present for each entry)
<dh`> it's easy enough to handroll a type using a tuple but it's a bunch of ugly boilerplate
<dh`> and there doesn't seem to be a way to use a functor to build those types either
bgs has joined #ocaml
<discocaml> <deepspacejohn> I don’t have a prefab solution, but “map which always has specific keys and each always holds a value” sounds like it could just be a record.
wingsorc has quit [Ping timeout: 248 seconds]
<discocaml> <darrenldl> or just a function from enum to whatever value
bgs has quit [Remote host closed the connection]
dmbaturin has joined #ocaml
xd1le has joined #ocaml
<dh`> neither of those can be iterated
<dh`> in particular, the record form ends up being the same as the tuple form
<discocaml> <deepspacejohn> Well, it can be iterated in an unrolled form: `let iter f t = f t.foo; f t.bar; f t.baz`
<discocaml> <geoff> The deriving_fields ppx may have some of what you are looking for
<discocaml> <geoff> The `deriving_fields` ppx may have some of what you are looking for
Haudegen has quit [Ping timeout: 256 seconds]
chrisz has quit [Ping timeout: 246 seconds]
waleee has quit [Ping timeout: 240 seconds]
chrisz has joined #ocaml
<dh`> ideally adding a constructor to the enum would cause the build to fail if the iterator didn't get updated
<dh`> but I suspect that's asking a lot
<dh`> it just seems an odd lacuna
terrorjack has quit [Quit: The Lounge - https://thelounge.chat]
terrorjack has joined #ocaml
<discocaml> <geoff> Ah I had the name wrong, forgot JS likes naming stuff _conv
trillion_exabyte has quit [Ping timeout: 240 seconds]
trillion_exabyte has joined #ocaml
bgs has joined #ocaml
czy has joined #ocaml
<dh`> yeah that seems a lot like what I want
jmiven has quit [Quit: reboot]
jmiven has joined #ocaml
Serpent7776 has joined #ocaml
bartholin has joined #ocaml
Serpent7776 has quit [Ping timeout: 268 seconds]
spip has joined #ocaml
azimut has quit [Ping timeout: 240 seconds]
Tuplanolla has joined #ocaml
Serpent7776 has joined #ocaml
noonien has quit [Quit: The Lounge - https://thelounge.chat]
trillion_exabyte has quit [Ping timeout: 240 seconds]
noonien has joined #ocaml
trillion_exabyte has joined #ocaml
Haudegen has joined #ocaml
waleee has joined #ocaml
wingsorc has joined #ocaml
xd1le has quit [Remote host closed the connection]
dhil has joined #ocaml
xd1le has joined #ocaml
czy has quit [Remote host closed the connection]
czy has joined #ocaml
Anarchos has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
bgs has quit [Ping timeout: 240 seconds]
bgs has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
John_Ivan has quit [Read error: Connection reset by peer]
bartholin has quit [Quit: Leaving]
azimut has joined #ocaml
motherfsck has joined #ocaml
trillion_exabyte has quit [Ping timeout: 268 seconds]
trillion_exabyte has joined #ocaml
Anarchos has joined #ocaml
motherfsck has quit [Ping timeout: 264 seconds]
gwizon has joined #ocaml
oriba has joined #ocaml
<oriba> after opam update/upgrade, ocaml 5.0.0 is installed.
<oriba> opam switch says default is 4.14.0 and used
<oriba> I thoght, opam does not switch automatically to newer compiler...
<oriba> thought
<oriba> installed stuff now is broken
<oriba> do I need to swithc back to what is officlially the switch?
<oriba> or switch forward?
rf has joined #ocaml
Anarchos has quit [Quit: Vision[]: i've been blurred!]
sparogy has quit [Remote host closed the connection]
sparogy has joined #ocaml
bartholin has joined #ocaml
xd1le has quit [Quit: xd1le]
alexherbo2 has joined #ocaml
haesbaert has joined #ocaml
<oriba> looks like a bug to me
azimut has quit [Ping timeout: 240 seconds]
azimut has joined #ocaml
<oriba> aha system installed ocaml was 5.0.0 and opam did not detected that
<oriba> now it breaks at other points
<oriba> opam sucks
<discocaml> <Kali> what were your steps?
<discocaml> <geoff> Try making a new switch with the compiler version you want
<oriba> I did that
<oriba> I then wanted to compile a project, and it said, wrong version of one of the libs
<oriba> I tried zpdate - anything fine
<oriba> I tried installing the lib - error messages
<discocaml> <geoff> Are you pinning any packages to particular versions?
<oriba> because of inconsistent assumptions on the base compiler
<oriba> I did not pinning
<discocaml> <geoff> Not so much an opam if the libraries you are trying to install have version constraints that don't line up
<discocaml> <geoff> *opam problem
<discocaml> <Kali> what were the commands you executed to get here?
<discocaml> <Kali> it should look something like this: ```
<discocaml> <Kali> opam update
<oriba> I try again in a new shell
<discocaml> <Kali> opam upgrade
<discocaml> <Kali> eval $(opam env)
<discocaml> <Kali> opam switch create 5.0.0
<discocaml> <Kali> opam switch set 5.0.0
<discocaml> <Kali> eval $(opam env)
<discocaml> <Kali> ```
<oriba> opam switch did work
<oriba> why does opam give me the default of a library of the other switch as if it is from the new switch?
<oriba> "is not a compiled interface for this version of OCaml"
<discocaml> <Kali> did you reinstall the package under the new switch?
<oriba> should not be available instead of just being there
<oriba> not when that message occured
<oriba> so the lib should not be available
<oriba> now I installed it
<oriba> same message
<discocaml> <geoff> What were the commands you ran
<oriba> I tried other compilations and goitinconsistency-errors
<oriba> opam install pcre
<oriba> eval $(opam env)
<discocaml> <Kali> if you do `opam switch set default && eval $(opam env)`, do the errors go away?
<oriba> no
<oriba> looks good
<oriba> I now could recreate the compiler-messages
<oriba> it seems that ocamlnet does need an older compiler?!?!
<discocaml> <geoff> Yes
<oriba> strange
<discocaml> <Kali> then it is the package's fault, not opam's
<oriba> ok
<oriba> the problem at the beginning was different
<oriba> system installed compiler was 5.0.0
<oriba> but I did not used the 5.0.0 switch
<oriba> no warings or errors
<oriba> when using opam report, there was the message that the underlying compiler has changed (or so)
<oriba> and the new compiler was presented as default opam compiler
<discocaml> <geoff> I believe the eval should come right after setting the switch (before doing anything else) but I could be wrong about that
<oriba> I would expect an error from opam, which says: I used ocaml version 4.14.0, now the compiler is 5.00, please create a switch ors o
<oriba> and when the switch has eben created, I would not expect to have the librs of the older switch active as default
<oriba> this looks somewhat similar: https://github.com/ocaml/opam/issues/5554
<oriba> last time when I had opam-problems, I deinstalled opam, wiped out $HOME/.opam, installed opam again, dit opam init and installed what I needed - problems were solved
<discocaml> <geoff> The old switch stuff being visible after setting a new switch I think would be because you need to eval the env
<oriba> opam: 415 Issues, 76 pull requests
<discocaml> <geoff> and?
<oriba> 46 Bugs
<oriba> hmhh
<discocaml> <Commutative Conjecture> Any one has an example of a dune file for menhir where you can depend on an external library? I am trying to use a core data structure in my semantic actions and i struggle
<discocaml> <Commutative Conjecture> Aaaa
<discocaml> <Commutative Conjecture> %{lib:core} doesn't work anymore on 3.0 so I can not use it to call ocamlc -i myself
bgs has quit [Remote host closed the connection]
trillion_exabyte has quit [Ping timeout: 248 seconds]
trillion_exabyte has joined #ocaml
<discocaml> <deepspacejohn> It should just have access to any libraries you have specified in the dune file's library/executable `(libraries ...)` stanza, unless I'm misunderstanding.
Serpent7776 has quit [Ping timeout: 248 seconds]
bartholin has quit [Quit: Leaving]
alexherbo2 has quit [Remote host closed the connection]
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
Tuplanolla has quit [Quit: Leaving.]