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
White_Flame has quit [Ping timeout: 240 seconds]
ygrek has quit [Remote host closed the connection]
White_Flame has joined #ocaml
mxns has quit [Ping timeout: 244 seconds]
ec has quit [Ping timeout: 244 seconds]
l1x has quit [Ping timeout: 244 seconds]
stylewarning has quit [Ping timeout: 244 seconds]
l1x has joined #ocaml
stylewarning has joined #ocaml
ec has joined #ocaml
Tuplanolla has quit [Ping timeout: 272 seconds]
<d_bot> <inkbottle> I have some comments in an executable which does build with `dune build -p mypackage`, but when I do `dune build @doc`, those comments do not translate in the generated documentation, which is mostly an empty shell.
<d_bot> <inkbottle> Maybe the answer is here: https://github.com/ocaml/dune/issues/1496
bjorkint0sh has joined #ocaml
bjorkintosh has quit [Read error: Connection reset by peer]
amiloradovsky has quit [Remote host closed the connection]
amiloradovsky has joined #ocaml
mfp has quit [Ping timeout: 260 seconds]
Haudegen has quit [Ping timeout: 240 seconds]
mxns has joined #ocaml
borne has quit [Ping timeout: 272 seconds]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
FreeBirdLjj has quit [Ping timeout: 256 seconds]
jbrown has quit [Ping timeout: 272 seconds]
jbrown has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
urek__ has quit [Ping timeout: 272 seconds]
narimiran has joined #ocaml
mxns has quit [Ping timeout: 246 seconds]
<d_bot> <cemerick> well, after a bunch of twiddling, I'm left pretty disillusioned by ocamlformat 😦
<d_bot> <cemerick> this thread is a bit dated, but it captures my sentiments decently https://discuss.ocaml.org/t/the-way-ocamlformat-formats/2741
<d_bot> <cemerick> and I guess insofar as ocp-indent is sorta-kinda deprecated (in "sustain" mode, to use the OCaml Platform nomenclature), I guess....we just won't use a standard formatting tool 🤷‍♂️
sagax has joined #ocaml
amiloradovsky has joined #ocaml
amiloradovsky has quit [Remote host closed the connection]
waleee-cl has quit [Quit: Connection closed for inactivity]
<def> ocp-indent works well, there is no need to give it up
flasd has joined #ocaml
decentpenguin has quit [Read error: Connection reset by peer]
decentpenguin has joined #ocaml
vicfred has quit [Quit: Leaving]
<d_bot> <joris> @cemerick ocaml format is very tunable. We managed to tweak it well enough so that it looks more classical at works
<d_bot> <joris> There are some issues like gadt online records are weird but mostly it is OK with enough tweaking
<steenuil> I don't know if it's a recent addition but I don't mind the "conventional" style
<steenuil> I remember not liking the predefined styles a while back and configuring it on top of the ocamlformat profile
Haudegen has joined #ocaml
Serpent7776 has joined #ocaml
sadiq has quit [Ping timeout: 256 seconds]
<zozozo> cemerick: ocp-indent is maintained and updated for the new syntaxes that come to ocaml (for instance the let punning in discussion in a PR), so I see no problem with using it (as do a lot of the community)
<zozozo> and personally I think ocamlformat has some fundamental flaws that will ever keep me from using it, because there are some cases when adequate hand-writtentline breaks help a lot with readability
sadiq has joined #ocaml
flasd has quit [Remote host closed the connection]
urek__ has joined #ocaml
urek__ is now known as urek
<d_bot> <beheddard> I finally set up ocamlformat recently and it's great. The janestreet profile with the `;;` turned off along with a couple other minor changes is a pretty nice default (for me)
Coueek[m] has quit [Quit: Idle for 30+ days]
<reynir> I'm happy with ocp-indent
mfp has joined #ocaml
olle has joined #ocaml
hnOsmium0001 has quit [Quit: Connection closed for inactivity]
<Leonidas> for me ocamlformat completely changed how I write code, it really frees up my mind
<Leonidas> cemerick: I think the solution would be to improve ocamlformat and not abandon it. At work we found it extremely useful, saved thousands of hours of bikeshedding.
<theblatte> the point of an auto-formatter is to stop thinking about formatting styles altogether, it's very liberating. just stop caring, it's all the same AST anyway ;)
<Leonidas> exactly, and it unifies everyone in hating the way the formatter formats :D
<theblatte> unity achieved :')
<theblatte> world peace following soon
Anarchos has joined #ocaml
borne has joined #ocaml
<d_bot> <joris> It frees your mind while coding too. I cannot work without it anymore
<d_bot> <joris> The 'it reduces readability' argument honestly in the beginning I was annoyed often with 0.8 but it has improved a lot, now respects user intent much more with lots of tunable to keep spacing and stuff
<d_bot> <joris> I don't think I come up with 'omg this is very ugly and reduce readability' more than once every 2 months
berberman_ has joined #ocaml
berberman has quit [Ping timeout: 264 seconds]
<d_bot> <joris> I'm going to argue you write the same proportion of less readable code manually when you are tired or in a hurry
<d_bot> <joris> And you loose all the benefits of automation
bartholin has joined #ocaml
borne has quit [Ping timeout: 246 seconds]
<d_bot> <ostera> if you have it run automatically on save, it also is a good first check of whether this will _not_ compile: if it formats, its valid ocaml
<d_bot> <ostera> so I can just keep writing/saving until it formats and _then_ look at the compiler output
<Anarchos> d_bot what tool ?
aaaaaa has quit [Ping timeout: 256 seconds]
decentpenguin has quit [Ping timeout: 256 seconds]
<d_bot> <joris> @ostera well, i have a hard time imagining why it is useful in a world where merlin exists :p but true
decentpenguin has joined #ocaml
<zozozo> with merlin and ocp-indent, I already have enough feedbakc about compilability when writing, ^^
<Anarchos> zozozo do you use vim ?
<zozozo> but I agree that in the context of team working it might be useful to unify styles, it's just that I'll most probably never use it in any of my personal projects, ^^
<zozozo> Anarchos: yup
gahr has quit [Quit: leaving]
<Anarchos> zozozo does ocp-indent indents automatically while writing ?
<zozozo> Anarchos: yup
<Anarchos> zozozo it does not for me
<zozozo> oh, give me a few seconds to paste you my config
<zozozo> Anarchos: i use the ocp-indent-vim plugin ( cf https://github.com/let-def/ocp-indent-vim )
<zozozo> and since I use the plugged plugin manager, all I need is a line like: "Plug 'def-lkb/ocp-indent-vim'"
<d_bot> <joris> I use neoformat it is nice
gahr has joined #ocaml
<d_bot> <joris> It works with lots of languages
gahr has quit [Client Quit]
gahr has joined #ocaml
borne has joined #ocaml
<Anarchos> zozozo i didn't know the plugged plugin manager
<zozozo> Anarchos: actually the name if vim-plug (cf https://github.com/junegunn/vim-plug ), not plugged; I said pluged because it's the name of the dir I use in my config for vim-plug to install the plugins, XD
osa1_ has joined #ocaml
osa1 has quit [Ping timeout: 272 seconds]
dhil has joined #ocaml
borne has quit [Ping timeout: 260 seconds]
ggole has joined #ocaml
zebrag has joined #ocaml
inkbottle has quit [Ping timeout: 265 seconds]
mosterdt has joined #ocaml
<d_bot> <Drup> for people experienced in github actions: is there a way to say something like "this step should be executed once, on whichever run of the matrix reaches it first" ?
<d_bot> <Drup> Well, maybe it's just a bad idea. 😐
tane has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
<olle> why once?
<olle> you're not supposed to have state in your test suite like that :d
nullcone has quit [Quit: Connection closed for inactivity]
<Drup> to upload the documentation.
<zozozo> Drup: I'd make uploading the documentation the last thing to run, assuming all other tests have succedded
Anarchos has quit [Quit: Vision[0.10.3]: i've been blurred!]
<Drup> sure, that doesn't help.
<zozozo> :p
<olle> Drup: touch a file with current timestamp, only upload new docs if it's older than 23h?
<olle> idk
<olle> hack the planet! :D
<olle> or maybe make doc upload a separate cronjob or something.
<olle> hm
<olle> nah, not good.
<d_bot> <Anurag> Why not make another GitHub action that only does doc generation and uploads them? They run in parallel and are pretty fast with caching.
Haudegen has joined #ocaml
waleee-cl has joined #ocaml
oni_on_ion has joined #ocaml
oni-on-ion has quit [Ping timeout: 240 seconds]
<d_bot> <psafont> I agree with Anurag's suggestion
berberman has joined #ocaml
<d_bot> <Drup> except doc generation uses the build artifact from ... building
berberman_ has quit [Ping timeout: 240 seconds]
<d_bot> <Anurag> You'd still need to build it once on that action so it isn't ideal, but you will get your build-only-once semantic 🙂
<d_bot> <Drup> the goal was *also* not to duplicate work
<d_bot> <psafont> you could add a guard to the step building the documentation
<Armael> you could maintain a separate k/v store accessible through a REST api
<d_bot> <psafont> so it's only build when certain matrix values are used
<Armael> that would be queried by the CI job to know whether docs have been built in another job
<d_bot> <psafont> *built
<d_bot> <Drup> Armael: that is ridiculously over-engineered
<Armael> yes that was not a serious proposal
<Armael> but it would work
<Armael> :-)
<d_bot> <Drup> @psafont that was my chosen solution, yeah, it means fixing a point of the matrix that is in charge of docs, it's actually rather sensible
<Enjolras> idk github action, but i'm surprised such basic feature is not supported :o (buildkite allows that for instance)
<d_bot> <Drup> Enjolras: guards or single execution ?
<d_bot> <Anurag> This seems like a really nice way to get the desired behavior!
<Enjolras> Drup: technically, neither, but your pipeline is a graph, so you can express it like a join node
<d_bot> <Drup> I guess you can do that too, but I have no idea how because github actions are expressed through fucking retarted YAML
<Enjolras> uhuh, buildkite also use yaml unfortunately, yeah :/
<d_bot> <Anurag> so does gitlab-ci and sourcehut's offering. I guess it comes with the space. So much ops tooling seems to have been designed around yaml :\
ygrek has joined #ocaml
amiloradovsky has joined #ocaml
Anarchos has joined #ocaml
octachron has quit [Quit: ZNC 1.7.5 - https://znc.in]
octachron has joined #ocaml
osa1_ is now known as osa1
amiloradovsky has quit [Remote host closed the connection]
<olle> at least yaml is Agile
<olle> ^^
neiluj has joined #ocaml
Haudegen has quit [Quit: Bin weg.]
bartholin has quit [Quit: Leaving]
<d_bot> <joris> You mean frAgile?
urek has quit [Ping timeout: 272 seconds]
<d_bot> <undu> I still have nightmares about ansible
<d_bot> <Anurag> ansible's scoping rules have caused me a lot of pain when I had to learn it for my current job
<d_bot> <joris> Don't wrorry salt and puppet are also nightmare level
<seliopou> hannes you there?
<Manis[m]> https://cdi.st maybe?
<d_bot> <joris> And puppet felt it was behind the cool kid with Ruby syntax and no yaml. So they added hiera to catch-up with the hype
<hannes> seliopou: yes, but on my way shopping
<hannes> seliopou: what's on your mind? feel free to bug me via /msg or email
<seliopou> quick Q: is there any plan to support ecc in mirage-crypto?
<hannes> seliopou: yes and no. so far, we have mirage/fiat for P256 and mirage/hacl for 25519
<seliopou> oh yeah ok
<seliopou> i thought I saw something about ecc somwhere but forgot the lib name
<hannes> seliopou: mainly the curves (25519 as well the signing part) -- some more curves are needed (+ECDSA)
hnOsmium0001 has joined #ocaml
<seliopou> hannes: ok thanks
vicfred has joined #ocaml
urek has joined #ocaml
urek has quit [Remote host closed the connection]
urek has joined #ocaml
mxns has joined #ocaml
<d_bot> <Cyclomatic Complexity> hi
<d_bot> <Cyclomatic Complexity> me with GADTs again
<d_bot> <Cyclomatic Complexity> https://pastebin.com/pZwqkwJK
<d_bot> <Cyclomatic Complexity> I am trying to get line 38 to type
<d_bot> <Cyclomatic Complexity> but i can't add variance annotation on 13
<d_bot> <Cyclomatic Complexity> so it fails
olle has quit [Ping timeout: 272 seconds]
<d_bot> <EduardoRFS> I want a anti-GADT tag on discord ;/
<d_bot> <Cyclomatic Complexity> 😄
<d_bot> <Cyclomatic Complexity> :potatoangry: might be the right one
Haudegen has joined #ocaml
ygrek has quit [Remote host closed the connection]
ygrek has joined #ocaml
nullcone has joined #ocaml
urek has quit [Ping timeout: 272 seconds]
urek has joined #ocaml
Tuplanolla has joined #ocaml
<d_bot> <octachron> You cannot mix subtyping and GADTs, this is unsound in general. Consider what happens to the classical equality witness GADT when coercing only one side of the equality.
<d_bot> <ggole> In this case you can do an `a_or_b` by means of an existential wrapper
<d_bot> <ggole> But will have to wrap and unwrap explicitly
<d_bot> <Cyclomatic Complexity> @octachron Thanks
jnavila has joined #ocaml
borne has joined #ocaml
berberman has quit [Ping timeout: 272 seconds]
berberman has joined #ocaml
neiluj has quit [Ping timeout: 256 seconds]
neiluj has joined #ocaml
<d_bot> <EduardoRFS> there is any way to define a custom `%` for format strings? Like `printf "string: %my" my_thing` the idea is to have a `%ignore` where you can have the following change
<d_bot> <EduardoRFS>
<d_bot> <EduardoRFS> ```ocaml
<d_bot> <EduardoRFS> printf "string: %s" my_string (* from *)
<d_bot> <EduardoRFS> printf "string: %ignore" my_string (* to *)
<d_bot> <EduardoRFS> ```
<Armael> not without a ppx; the format strings are parsed by the compiler (and turned a format datatype)
<d_bot> <ulrikstrid> @Drup I think you can export the docs as a artifact from every build and then have a Cron action that takes the latest artifact and publish it every 24 hours
mxns has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
mxns has quit [Ping timeout: 272 seconds]
mxns has joined #ocaml
ggole has quit [Quit: Leaving]
<d_bot> <tjammer> Hi everyone. I have a ctypes problem I can't seem to solve.
<d_bot> <tjammer> The bindings I'm doing with ctypes work, but I didn't generate an interface file. Since the type descriptions generated by ctypes are huge (`(Types.Vector3.t, [ `Struct ]) Ctypes.structur
<d_bot> <tjammer> meh
mxns has quit [Ping timeout: 240 seconds]
<d_bot> <tjammer> Since the type descriptions are huge I would like to seal the interface and make the types abstract (just Vector3.t, so they are less distracting in emacs. My problem is that naturally they don't work anymore with Ctypes functions like Ctypes.addr
<d_bot> <tjammer> Can I have these types both shorter and still usable?
delysin has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
narimiran has quit [Ping timeout: 256 seconds]
<d_bot> <philzook> Hi, I'm trying to use a phantom type parameter and I can't figure out either how to suppress the warning or change the definition to get ride of the warning. `type ('a ,'b) mznmap = 'b list` results in warning `Error (warning 27): unused variable poly_a.`
<d_bot> <octonary> `type (_,'b) mznmap = 'b list` should work
<d_bot> <philzook> ```latency : (insn , int) mznmap
<d_bot> <philzook> Error: This expression should not be a function, the expected type is ('a, insn) mznmap``` I get this other error at use sites then?
mxns has quit [Ping timeout: 264 seconds]
aaaaaa has joined #ocaml
<d_bot> <philzook> Oh. I see. This might be a weird interaction with deriving yojson.
mxns has joined #ocaml
<d_bot> <ostera> @EduardoRFS if you're using `Format.fpritnf` you can use `%a` to compose other custom pretty printers -- not exacty the same but could be of use
mxns has quit [Ping timeout: 272 seconds]
urek has quit [Ping timeout: 256 seconds]
oni_on_ion is now known as oni-on-ion
Anarchos has quit [Quit: time to sleep]
madroach has quit [Ping timeout: 256 seconds]
mxns has joined #ocaml
madroach has joined #ocaml
urek has joined #ocaml
aaaaaa has quit [Quit: leaving]
jnavila has quit [Quit: Konversation terminated!]
neiluj has quit [Quit: leaving]
borne has quit [Ping timeout: 240 seconds]
borne has joined #ocaml
peterbb has joined #ocaml
peterbb has quit [Remote host closed the connection]
<d_bot> <inkbottle> I've git-cloned opium, then I've done `esy`, then `esy b dune build @install`.
<d_bot> <inkbottle> When I `ocaml-lsp-server/emacs` open `.ml` file, the second line is squiggle-underlined.
<d_bot> <inkbottle> Only in that project I have that.
<d_bot> <inkbottle> Also, mouse hovering provides very limited information, most of the time `'a`.
<d_bot> <inkbottle> For example, in `opium.ml`, mouse-hovering does provide the signature for `Middleware`, but every function is given type `'a`.
borne has quit [Ping timeout: 272 seconds]
raver has quit [Remote host closed the connection]
mxns has quit [Ping timeout: 256 seconds]
borne has joined #ocaml
tane has quit [Quit: Leaving]
amiloradovsky has joined #ocaml
mxns has joined #ocaml
<d_bot> <inkbottle> `git clone https://github.com/rgrinberg/opium.git`
<d_bot> <inkbottle> `cd opium`
<d_bot> <inkbottle> `esy`
<d_bot> <inkbottle> (Then I've added `ocaml-lsp-server` in the `dune-project` `(depends ...)`, in every packages.)
<d_bot> <inkbottle> `esy b dune build @install` (this causes opam files regeneration, and actually the subsequent installation of "everything" (?))
<d_bot> <inkbottle> `esy emacs .&`
<d_bot> <inkbottle> Then open `opium.ml`: no squiggles, mouse-hovering shows a ton of useful and relevant information.
<d_bot> <inkbottle> Same configuration, but doing plain `emacs .&` results in squiggled second line and limited, broken information when mouse-hovering.
<d_bot> <inkbottle> I'm not absolutely sure of what happens when without `ocaml-lsp-server` in the `dune-project` dependencies, but I think it didn't work well either.
<d_bot> <inkbottle> [It does work elsewhere on the same computer, but since `opium` did cause installation of ocaml 4.11.1, maybe there were some `make inconsistent assumptions over interface` behind the scene? (default opam shift showing 4.10.0.)
<d_bot> <inkbottle> Anyway, this was initially a question that I posted inadvertently; this is the maybe-answer.]