Open ebblake opened 5 years ago
In my opinion, both are fine. Tuareg uses the latter by default because it improves readability by showing the structure. ocamlformat
does not and it is OK. You can configure Tuareg to use that style too and even change it per project.
https://ocaml.org/learn/tutorials/guidelines.html has several recommendations on formatting match patterns, but notably lacks any guidance on the following: when using more than one pattern that both share the same ->, should the second | be indented in relation to the first (to make it obvious that the first lacks ->) or should the | be aligned? Visually, this is the difference between:
and:
emacs-tuareg-2.0.10-5.fc29.noarch, as shipped on Fedora, favors indentation of the secondary patterns (the latter style), although that gets in my way when editing a project that favors the style of always aligning the | (the first style). If the style guide were to state a preference for one way or the other, then the tuareg defaults could match that style (whether or not tuareg also adds a user customization to make it easier to change between the two styles).