Where to find complete documentation on syntax overloading in OCaml?

Hi @chshersh

The documentation update we’ve started releasing includes a new tutorial on operators:

I’ve tried summarizing and grouping what’s in the reference manual and a couple of blog posts, in a readable form. Alas, it doesn’t cover the case of reusing the list syntactic sugar, yet. I’d be super happy if somebody could contribute some text. Up to my findings, documentation is available on unary operators, binary operators, indexing operators and custom binders. But I couldn’t find anything about what you mentioned. Interestingly, if you ask ChatGPT about that, it falls into a bad trip, which suggests it wasn’t fed with anything on that matter, probably because there isn’t anything available.

Also, I searched https://sherlocode.com/ with something like this:

\[^a-z_\]type \.\*=\.\*( \[^A-Z\]

It seems to indicate the list syntax is the only one we can play with (although this regexp needs to be improved)

P.S. The tutorial is brand new; any feedback would be appreciated

3 Likes