let-style

DescriptionStyling of let blocks
Options
  • auto
  • inline
  • newline
  • mixed
Defaultauto
Ormoluinline
Sincev0.9.0.0

This option determines whether the clauses in a let block should be on the same line as the let/in keywords (inline) or on the next line (newline).

The auto style (the default) uses whatever style the user uses at the call-site. This does mean that a codebase might have different let styles, but it allows the user to decide which style makes the most sense on a case-by-case basis.

The mixed style uses inline if the let binding has only one binding or newline if the let binding has multiple.

Examples

testUser =
    let name = "Alice"
        age = 30
     in User name age
testUser =
    let
        name = "Alice"
        age = 30
     in
        User name age

For more examples, see the test files.

See also