-
Notifications
You must be signed in to change notification settings - Fork 207
Open
Labels
Description
Function arguments are indented in different ways depending on context:
let _ =
fun (module Store : Irmin.Generic_key.S with type repo = repo)
(module Store : Irmin.Generic_key.S with type repo = repo) ->
body
let _ =
f
(fun
(module Store : Irmin.Generic_key.S with type repo = repo)
(module Store : Irmin.Generic_key.S with type repo = repo)
-> body )
let f (module Store : Irmin.Generic_key.S with type repo = repo)
(module Store : Irmin.Generic_key.S with type repo = repo) =
bodyThis example contains a regression: (red is 0.25.1)
@@ -8,7 +8,7 @@ let _ =
(fun
(module Store : Irmin.Generic_key.S with type repo = repo)
(module Store : Irmin.Generic_key.S with type repo = repo)
- -> body )
+ -> body )
let f (module Store : Irmin.Generic_key.S with type repo = repo)
(module Store : Irmin.Generic_key.S with type repo = repo) =I propose the following formatting:
- Arguments are indented 2 more than the body.
Helps to distinguish where the body starts. - The arrow/equal is on the right of the last argument.
- Body of
funpassed as argument is aligned with the keyword.
This applies tofunwrapped in parentheses. - Dock the
funkeyword when it's the body of a let.
Gets rid of the 1-indentedfunand is more consistent with the sugared form.
let _ = fun
(module Store : Irmin.Generic_key.S with type repo = repo)
(module Store : Irmin.Generic_key.S with type repo = repo) ->
body
let _ =
f
(fun
(module Store : Irmin.Generic_key.S with type repo = repo)
(module Store : Irmin.Generic_key.S with type repo = repo) ->
body )
let f
(module Store : Irmin.Generic_key.S with type repo = repo)
(module Store : Irmin.Generic_key.S with type repo = repo) =
bodymetanivek and chshersh