Here is the list of basic indentation and spacing principles that we try to observe in MetaPRL:
match
expression
with
Choice1 ->
code1
| Choice2 ->
code2
| Choice3 ...
When expression is short, its OK to use
match expression with Choice1 -> ...When codei is short, it's usually OK to put it on the same line with Codei (but not with Codei+1).
let variable = expression in codeif expression is short, it's OK to use either
let variable = expression in codeor
let variable = expression in codeor even
let variable = expression in codeOn the other hand, the following is discouraged:
let very_long_variable_name = { field1 = code1;
field2 = code21...
code22...
.....
since it pushes the code too far to the right and makes it very
hard to read in a narrow window.
Instead, use
let very_long_variable_name =
{ field1 = code1;
field2 =
code21...
code22...
...
let variable = expression in code