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/
ania123 has quit [Quit: Ping timeout (120 seconds)]
random-jellyfish has joined #ocaml
random-jellyfish has quit [Changing host]
random-jellyfish has joined #ocaml
_whitelogger_ has joined #ocaml
Fardale has joined #ocaml
rom1504 has joined #ocaml
chrisz has quit [Ping timeout: 255 seconds]
chrisz has joined #ocaml
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
waleee has quit [Ping timeout: 260 seconds]
random-jellyfish has quit [Ping timeout: 264 seconds]
aljazmc has joined #ocaml
aljazmc has quit [Read error: Connection reset by peer]
<discocaml> <xfcisco> does anyone know of a server for the lean programming language ?
<discocaml> <andreypopp> They have zulip instance, not sure about discord, maybe unofficial
bartholin has joined #ocaml
yoyofreeman has joined #ocaml
random-jellyfish has joined #ocaml
random-jellyfish has quit [Changing host]
random-jellyfish has joined #ocaml
Serpent7776 has joined #ocaml
bartholin has quit [Quit: Leaving]
<discocaml> <lukstafi> Hi! What's the go-to simplest test framework for which `dune test --auto-promote` works?
<discocaml> <lukstafi> Or if simpler, just `dune test` works?
yoyofreeman has quit [Remote host closed the connection]
yoyofreeman has joined #ocaml
<discocaml> <andreypopp> I'd say https://dune.readthedocs.io/en/stable/tests.html#cram-tests and then there's also mdx
yoyofreeman has quit [Max SendQ exceeded]
yoyofreeman has joined #ocaml
mro has joined #ocaml
<discocaml> <lukstafi> I guess I found my answer: https://ocaml.org/docs/running-executables-and-tests-with-dune#running-tests (although would be nice if there was also a section in the tutorial).
<discocaml> <lukstafi> But good that I checked and not went through with the instinctive `(library (inline_tests))`
<hiddenman> zozozo, hi. regarding local opam repository. i've just cloned https://github.com/ocaml/opam-repository/ and run "opam admin cache ./cache" inside it. anyway, it connects to the github for every package and sync it :(
<hiddenman> like this: [pgx_lwt.1.0] synchronised (https://github.com/arenadotio/pgx/releases/download/1.0/pgx-1.0.tbz)
<hiddenman> may be i had to mirror the repo with lfs?
<hiddenman> no, that didn't help. looks like i have to use opam-bundle and fetch sources of everything and then compile everything :(
<hiddenman> because each package has it's own repository in the github and its archives
Serpent7776 has quit [Ping timeout: 245 seconds]
wingsorc has quit [Ping timeout: 245 seconds]
aljazmc has joined #ocaml
yoyofreeman has quit [Remote host closed the connection]
yoyofreeman has joined #ocaml
Serpent7776 has joined #ocaml
<zozozo> hiddenman: once you have cloned the repo (and probably only kept the package you're interested in), running `opam admin cache./cache` should download every tarball and put in the cache directory iiuc (hence why it should be a good idea to trim the repo first, else you'll download way too many things), and then afterwards, you can configure the repo to serve tarballs from the downloaded cache (you'll
<zozozo> probably have to configure your opam to use only your local repository and not the default online one though)
yoyofreeman has quit [Remote host closed the connection]
<hiddenman> zozozo, yes, i understand this (actually, i'm not sure what packages i need, because there are lots of recursive deps). the main problem is that i wanted to create a reproducible build: store everything in my local git, then create a cache from it and use. but realized that cache is made by downloading tar.gz for each package from the internet. of course i can sync all packages and just tar.gz the whole directory, but i want to have more elegant
<hiddenman> solution ;-)
<hiddenman> so right now i'm determining the required packages and just create git clones for them. and then will use opam pin add git_url for each package
<hiddenman> so opam will compile then everytime during the build
<zozozo> ok, in that case, opam-bundle might be a good solution, as it should create a tarball for you (though the build time might be a bit long)
<hiddenman> zozozo, yes, that's another solution. might be better, experimenting right now. actually, that's annoying problem with the most of the modern languages nowadays: erlang, python, golang, ocaml, npm, etc. especially golang and npm :) there are thousands of packages all around a world and i have to fetch all of them manually, compile and so on. i'd prefer to have everything in the stdlib :)
<zozozo> hiddenman: oh actually, you could try https://github.com/tarides/opam-monorepo , which I think should fetch all of your deps and build everything locally
<zozozo> although that maily (only ?) works with projects that use dune as the build system
<zozozo> *mainly
<hiddenman> zozozo, hmm, interesting as well. thank you
<hiddenman> guys. ocaml-compiler-libs (https://github.com/janestreet/ocaml-compiler-libs) wants "ocaml" {>= "5.2.0"}, but i have 4.13.1. how do i determine what ocaml-compiler-libs version to use so it will be compatible with my ocaml 4.13.1?
<hiddenman> looks like they added this to the master branch, tags releases do not have this
mro has quit [Remote host closed the connection]
mro has joined #ocaml
<hiddenman> another curious thing is that i have to manually determine the order of the pinned packages. for example, i'm pinning ppxlib and it wants sexplib0. i also have sexplib0 pin, but it goes after ppxlib in my script and opam doesnt know that (of course) and tries to install sexplib0 from the github
<hiddenman> is there any way to add all pinned packages and only after that start building of them?
mro has quit [Ping timeout: 264 seconds]
yoyofreeman has joined #ocaml
yoyofreeman has quit [Remote host closed the connection]
mro has joined #ocaml
edr has joined #ocaml
<zozozo> hiddenman: you can "opam pin -n" which will only pin the package and not try to install it
rak has quit [Quit: Segmentation fault (core recycled)]
rak has joined #ocaml
<hiddenman> zozozo, ok, thank you!
rak has quit [Quit: Segmentation fault (core recycled)]
<hiddenman> i managed to pin everything and compile the required library. so thank you everyone for help
<hiddenman> the only question i do not understand is conf* packages
<hiddenman> for example, what is that? https://opam.ocaml.org/packages/conf-libpcre/
<hiddenman> it links to the ocaml-pcre package which is already pinned and compiled. however, this conf-libpcre is installed somehow from somewhere, looks like this is just metadata, but i'm not sure
rak has joined #ocaml
<discocaml> <._null._> conf-* packages are virtual packages for external dependencies, they are nothing but an opam file
mro has quit [Ping timeout: 255 seconds]
<hiddenman> ah, ok, it will not install anything unexpected
dnh has joined #ocaml
Serpent7776 has quit [Quit: leaving]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dnh has joined #ocaml
mro has joined #ocaml
mro has quit [Ping timeout: 255 seconds]
aljazmc_ has joined #ocaml
aljazmc has quit [Remote host closed the connection]
<discocaml> <'a patate> Is there a specific name for a function doing kind of the inverse of map?
<discocaml> <'a patate> That is, from a function taking the wrapped type, create a function on the unwrapped type...
<discocaml> <'a patate> ```ocaml
<discocaml> <'a patate> val dew: ('a t -> 'b t) -> 'a -> 'b
<discocaml> <'a patate> (* example with Option.t: *)
<discocaml> <'a patate> let dew f a = f (Some a) |> Option.get
<discocaml> <'a patate> ```
<discocaml> <'a patate> Here I call it dew, because if you rotate it it makes map. Funny.
<discocaml> <'a patate> (yes, I know it can throw an exception, shhh 🤫 )
<companion_cube> but it's not always correct, right?
<companion_cube> yeah
<discocaml> <'a patate> right
<discocaml> <'a patate> In my special case, it will always be correct
mro has joined #ocaml
<discocaml> <'a patate> something like this:
<discocaml> <'a patate> ```ocaml
<discocaml> <'a patate> type 'a t = 'a * some_irrelevant_data
<discocaml> <'a patate> let dew f a = f (a, dont_care) |> fst
<discocaml> <'a patate> ```
<companion_cube> ah but it's not the same as iwth option :p
<discocaml> <'a patate> Why so?
<companion_cube> because you literally always have a single `'a`
<companion_cube> not sure what the right concept for that would be though
<discocaml> <'a patate> Oh yes, on some types you would have to "cheat" a little...
mro has quit [Ping timeout: 252 seconds]
mro has joined #ocaml
mro has quit [Remote host closed the connection]
gentauro has quit [Read error: Connection reset by peer]
gentauro has joined #ocaml
bartholin has joined #ocaml
CO2 has quit [Quit: WeeChat 4.1.0]
random-jellyfish has quit [Ping timeout: 258 seconds]
waleee has joined #ocaml
CO2 has joined #ocaml
CO2 has quit [Quit: WeeChat 4.1.0]
CO2 has joined #ocaml
Tuplanolla has joined #ocaml
humasect has joined #ocaml
humasect has quit [Client Quit]
waleee has quit [Ping timeout: 255 seconds]
waleee has joined #ocaml
CO2 has quit [Quit: WeeChat 4.1.0]
dnh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
waleee has quit [Ping timeout: 255 seconds]
CO2 has joined #ocaml
waleee has joined #ocaml
bartholin has quit [Quit: Leaving]
aljazmc_ has quit [Remote host closed the connection]
wingsorc has joined #ocaml
waleee has quit [Quit: WeeChat 4.0.2]
Tuplanolla has quit [Quit: Leaving.]