Verbose Syntax
There are two forms of syntax available for many constructs in F#: verbose syntax and lightweight syntax. The verbose syntax is not as commonly used, but has the advantage of being less sensitive to indentation. The lightweight syntax is shorter and uses indentation to signal the beginning and end of constructs, rather than additional keywords like begin, end, in, and so on. The default syntax is the lightweight syntax. This topic describes the syntax for F# constructs when lightweight syntax is not enabled. Verbose syntax is always enabled, so even if you enable lightweight syntax, you can still use verbose syntax for some constructs.
Table of Constructs
The following table shows the lightweight and verbose syntax for F# language constructs in contexts where there is a difference between the two forms. In this table, angle brackets (<>) enclose user-supplied syntax elements. Refer to the documentation for each language construct for more detailed information about the syntax used within these constructs.
| Language construct | Lightweight syntax | Verbose syntax |
|---|---|---|
| compound expressions |
|
|
|
nested |
|
|
| code block |
|
|
| `for...do` |
|
|
| `while...do` |
|
|
| `for...in` |
|
|
| `do` |
|
|
| record |
|
|
| class |
|
|
| structure |
|
|
| discriminated union |
|
|
| interface |
|
|
| object expression |
|
|
| interface implementation |
|
|
| type extension |
|
|
| module |
|
|
See also
Feedback
Submit and view feedback for

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.
