Skip to content

Conversation

@EmileTrotignon
Copy link
Collaborator

Lwt.run
@@ match x with
| A -> a
| B -> b

instead of

Lwt.run
@@
match x with
| A -> a
| B -> b

This is good because there is one less newline, and because it is more consistent with the @@ function formatting:

Lwt.run
@@ function
| A -> a
| B -> b

There are two issues that need to be addressed before merging:

  • with operator ||, it looks weird:
my_bool
|| match x with
| A -> true
| B -> false

Maybe this is okay. The same weirdness could also happen with function, even if its less likely.

  • when the match is in parens, the code says it shouldnt format like it does, but it still does, with a weird indentation:
let _ =
  foo
  $$ (match group with
    | [] -> impossible "previous match"
    | [ cmt ] -> fmt_cmt t conf cmt ~fmt_code $ maybe_newline ~next cmt)
  $$ bar
;;

This is not necessarily bad, but the indentation should be fixed, and why this is happening should be understood before merging.

|| has_doc i1 || has_doc i2
||
match
|| match
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thats not great, also needs to be addressed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant