fsharp / fsharp/fslang-design

[style-guide] Lambda closing paren defaults

Open
#730 5 comments 7 reactions 0 assignees View on GitHub
Dominant language
F#
Stars
557
Forks
149
Avg merge
4d 13h
Merged PRs (30d)
2

Description

There's inconsistency of how closing bracket is placed with default Fantomas settings:
```fsharp
// closing bracket is on the new line
seq {
//
return ()
}

// closing bracket is on the expression line
seq (fun _ ->
//
())

// closing bracket is on the new line
someTupledFunction (
"A very long string making all of this multi-line",
"A very long string making all of this multi-line"
)
```

I suggest we could try to move closing bracket in lambdas to a new line, so it's more inline with other similar constructions. It would also make it easier to edit the lambda if the closing bracket was on a new line:
```fsharp
seq (fun _ ->
//
()
)
```

Moving the closing bracket like this is already supported in Fantomas, but it's not turned on by default.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.