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

Be explicit about formatting member declarations which are too long #16

Merged
merged 1 commit into from
Jan 19, 2021
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
Be explicit about formatting member declarations which are too long
Smaug123 committed Jan 15, 2021

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
commit 287f9866e7e04463fd9268a9314959062bdcda79
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -158,6 +158,61 @@ type C
// ... the body of the class follows
```

### Place parameters on a new line for member declarations

If a member declaration is too long to fit on one line, split it up into one member per line.

```fsharp
type Foo =
abstract Qux :
string
-> string
-> int

type Bar =
abstract Qux :
input : string
-> modifier : string
-> int

type Baz =
abstract Qux :
[<Attribute>] input : string
-> [<Attribute>] modifier : string
-> int
```

In the same way, format tuples over new lines if the declaration is too long to fit on one line:

```fsharp
type Foo =
abstract Qux :
string
* string
-> int

type Bar =
abstract Qux :
input : string
* modifier : string
-> int

type Baz =
abstract Qux :
[<Attribute>] input : string
* [<Attribute>] modifier : string
-> int

type Both =
/// int -> (string * int * string) -> string
abstract Qux :
i : int ->
a : string
* foo : int
* otherInput : string ->
string
```

### Type annotations

#### Pad function argument type annotations