Skip to content

Commit

Permalink
Merge pull request #39096 from MangelMaxime/fsharp_long_secondary_con…
Browse files Browse the repository at this point in the history
…structor_example

F# - Add an example for formatting long secondary constructor
  • Loading branch information
vzarytovskii authored Jan 12, 2024
2 parents 84e066b + 43064c6 commit 548fc33
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions docs/fsharp/style-guide/formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -1651,6 +1651,16 @@ type TypeWithLongConstructor
aThirdVeryLongCtorParam: AVeryLongTypeThatYouNeedToUse
) =
// ... the body of the class follows
// ✔️ OK
type TypeWithLongSecondaryConstructor () =
new
(
aVeryLongCtorParam: AVeryLongTypeThatYouNeedToUse,
aSecondVeryLongCtorParam: AVeryLongTypeThatYouNeedToUse,
aThirdVeryLongCtorParam: AVeryLongTypeThatYouNeedToUse
) =
// ... the body of the constructor follows
```

If the parameters are curried, place the `=` character along with any return type on a new line:
Expand Down

0 comments on commit 548fc33

Please sign in to comment.