Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fsharp/style/formatting: space (many curried args) #28141

Merged
merged 3 commits into from
Feb 9, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 19 additions & 2 deletions docs/fsharp/style-guide/formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,10 +195,27 @@ Parentheses should be omitted unless arguments require them:
someFunction1 x.IngredientName

// ❌ Not preferred - parentheses should be omitted unless required
someFunction1(x.IngredientName)
someFunction1 (x.IngredientName)

// ✔️ OK - parentheses are required
someFunction1 (convertVolumeToLiter x)
```

Spaces should not be omitted when invoking with multiple curried arguments:

```fsharp
// ✔️ OK
someFunction1 (convertVolumeToLiter x) (convertVolumeUSPint x)
someFunction2 (convertVolumeToLiter y) y
someFunction3 z (convertVolumeUSPint z)

// ❌ Not preferred - spaces should not be omitted between arguments
someFunction1(convertVolumeToLiter x)(convertVolumeUSPint x)
someFunction2(convertVolumeToLiter y) y
someFunction3 z(convertVolumeUSPint z)
```

In default formatting conventions, a space is added when applying lower-case functions to tupled or parenthesized arguments:
In default formatting conventions, a space is added when applying lower-case functions to tupled or parenthesized arguments (even when a single argument is used):

```fsharp
// ✔️ OK
Expand Down