Enforce newline after assignment / clause.

This leads to more consistent formatting across entire Aiken programs.
  Before that commit, only long expressions would be formatted on a
  newline, causing non-consistent formatting and additional reading
  barrier when looking at source code.

  Programs also now take more vertical space, which is better for more
  friendly diffing in version control systems (especially git).
This commit is contained in:
KtorZ
2023-03-16 19:42:57 +01:00
parent bf9297efcf
commit 20f5baffa7
60 changed files with 998 additions and 548 deletions

View File

@@ -15,14 +15,16 @@ test foo() {
fn map(list: List<a>, f: fn(a) -> b) -> List<b> {
when list is {
[] -> []
[x, ..xs] -> [f(x), ..map(xs, f)]
[] ->
[]
[x, ..xs] ->
[f(x), ..map(xs, f)]
}
}
fn get_fields(data: Data) -> List<Int> {
builtin.un_constr_data(data).2nd
|> map(builtin.un_i_data)
|> map(builtin.un_i_data)
}
test bar() {