Leonidas changed the topic of #ocaml to: Discussion about the OCaml programming language | http://www.ocaml.org | OCaml 5.1.1 released: https://ocaml.org/releases/5.1.1 | Try OCaml in your browser: https://try.ocamlpro.com | Public channel logs at https://libera.irclog.whitequark.org/ocaml/
meritamen has joined #ocaml
Tuplanolla has quit [Quit: Leaving.]
oriba has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
meritamen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
meritamen has joined #ocaml
azimut has quit [Ping timeout: 240 seconds]
meritamen has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
waleee has quit [Ping timeout: 240 seconds]
rgrinberg has quit [Ping timeout: 256 seconds]
rgrinberg has joined #ocaml
trev has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
trev has quit [Quit: trev]
trev has joined #ocaml
trev has quit [Quit: trev]
trev has joined #ocaml
meritamen has joined #ocaml
jlrnick has joined #ocaml
meritamen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mro has joined #ocaml
bibi_ has quit [Quit: Konversation terminated!]
trev has quit [Quit: trev]
trev has joined #ocaml
trev has quit [Client Quit]
trev has joined #ocaml
gahr has quit [Remote host closed the connection]
mro has quit [Ping timeout: 268 seconds]
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
gahr has joined #ocaml
mro has joined #ocaml
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
meritamen has joined #ocaml
bartholin has joined #ocaml
average has joined #ocaml
meritamen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
trev has quit [Quit: trev]
trev has joined #ocaml
meritamen has joined #ocaml
hsw has quit [Quit: Leaving]
azimut has joined #ocaml
pi3ce has quit [Ping timeout: 256 seconds]
pi3ce has joined #ocaml
wingsorc has quit [Ping timeout: 268 seconds]
jlrnick has quit [Ping timeout: 240 seconds]
meritamen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
meritamen has joined #ocaml
trev has quit [Quit: trev]
trev has joined #ocaml
meritamen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
meritamen has joined #ocaml
meritamen has quit [Remote host closed the connection]
<discocaml> <lukstafi> Installing `opam` from source on FreeBSD now. Man it takes hours, and with the nice UI to configure dependencies...
<Johann> Hi, I try to create a pretty printing function that would accept optional argument such as `let pp ?(pp_sep fmt () = ()) fmt t = ...`. My issue is, how can I use it without the optional parameter in context such as `Format.printf "%a" pp my_var`? It raises a type error since the type doesn't match.
<Johann> I guess I have to use `fun f t -> pp f t` instead of pp directly but it is a little ugly and I m wondering if there is a better way
<discocaml> <_ggole> You can put a `()` after the optional argument, and if you pass that arg the optional argument will be erased; then you can use `(pp ())` instead of just `pp`
<discocaml> <_ggole> Still a bit ugly
<discocaml> <_ggole> Maybe better to just have two different functions
<octachron> You can also use (pp ?pp_sep:None).
<octachron> Another option is to use %t format specifier rather than %a.
<octachron> which would replace `Format.printf "%a" pp my_var` by `Format.printf "%t" (pp my_var)`.
<octachron> which is friendler to optional argument.
<discocaml> <_ggole> I always forget that `%t` even exists
<Johann> thanks I didn't know about `%t`!
<mro> TIL %t, thanks octachron!
<octachron> Note that it requires a different `pp` function that takes the formatter argument last. (which can be sometimes easier to define with `dprintf` rather than `fprintf`: `let pp (x,y) = Format.dprintf "(%d,%d)" x y`
<mro> ic
azimut has quit [Remote host closed the connection]
azimut has joined #ocaml
<companion_cube> I forget about dprintf
<companion_cube> @since 4.08 <--- awesome!!
gahr has quit [Remote host closed the connection]
gahr has joined #ocaml
<discocaml> <froyo> format is such a rabbit hole
rgrinberg has joined #ocaml
<companion_cube> it is, but it's also awfully convenient
edr has joined #ocaml
pi3ce has quit [Quit: No Ping reply in 180 seconds.]
<discocaml> <darrenldl> i still have no clue if `@[<v>%a@,@]` is the right way end with a newline, but good enough im hoping
pi3ce has joined #ocaml
<discocaml> <lukstafi> (I made the mistake if not listing the dependencies and trying to `pkg install` as much as possible before invoking `make install`.)
rgrinberg has quit [Read error: Connection reset by peer]
rgrinberg has joined #ocaml
<discocaml> <lukstafi> 🤦‍♂️ `pkg install ocaml-opam` would work. (Ahh I somehow tried `pkg install opam` I think?)
rgrinberg has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
jlrnick has joined #ocaml
yewscion has joined #ocaml
deadmarshal_ has quit [Ping timeout: 268 seconds]
<mro> pkg? Are you on freebsd, too?
yewscion has quit [Ping timeout: 252 seconds]
bibi_ has joined #ocaml
dnaq has quit [Remote host closed the connection]
dnaq has joined #ocaml
yewscion has joined #ocaml
deadmarshal_ has joined #ocaml
mro has quit [Quit: Leaving]
habnabit_ has quit [Ping timeout: 268 seconds]
jlrnick has quit [Ping timeout: 245 seconds]
<discocaml> <lukstafi> I'm trying to install freebsd but not feeling good about it. Haven't managed to `startx` yet. I had previously used NomadBSD for testing, had better luck with it but wanted the more standard distribution.
rgrinberg has joined #ocaml
rgrinberg has quit [Quit: Textual IRC Client: www.textualapp.com]
<discocaml> <druimalban> It used to be harder (especially with Nvidia drivers) but it's got a lot better since 11.0-RELEASE. Make sure your user is in the video group (see pw(8)) and it's usually easiest to start X with xdm(8)
average has quit [Quit: Connection closed for inactivity]
<discocaml> <druimalban> IME OpenBSD and NetBSD have historically had better working X11 out of the box. But it was OpenSolaris (and its descendents) which have the most friendly and well-thought-out X11 environment of any.
yewscion has quit [Ping timeout: 256 seconds]
jlrnick has joined #ocaml
gdd has joined #ocaml
jlrnick has quit [Ping timeout: 256 seconds]
<discocaml> <Alistair> When running `dune build @doc` I get a bunch of `Warning: Failed to resolve reference unresolvedroot(Invalid_argument) Couldn't find "Invalid_argument"` errors, any idea on how to fix this?
Tuplanolla has joined #ocaml
yewscion has joined #ocaml
wingsorc has joined #ocaml
<discocaml> <lukstafi> @mro With NomadBSD, graphics and WiFi worked out of the box, but `opam update` was hanging indefinitely for me.
yewscion has quit [Ping timeout: 256 seconds]
trev has quit [Quit: trev]
Exa has quit [Quit: see ya!]
Exa has joined #ocaml
azimut_ has joined #ocaml
azimut has quit [Ping timeout: 240 seconds]
oriba has joined #ocaml
xd1le has quit [Quit: xd1le]
bartholin has quit [Quit: Leaving]
<discocaml> <froyo> niklaus wirth, the man whose design fingerprints were all over ml and subsequently ocaml, died on jan 1st
waleee has joined #ocaml
<companion_cube> RIP