Skip to content

Detached head in case of long operators #1174

@cblp

Description

@cblp

When using a long operator (infix application), the "head" becames "detached" from a body for a very long distance.

Examples:

examples =
  x
    `veryLongFunctionNameUsedAsOperator` head
      body
      tail
    <----------------------------------> head
      { body,
        tail
      }

Expected

examples =
  x
    `veryLongFunctionNameUsedAsOperator`
      head
        body
        tail
    <---------------------------------->
      head
        { body,
          tail
        }

For me personally, any operator of width >1 is long, but Ormolu maintainers may have another taste.

Better solution: just preserve the line break after the operator.

Metadata

Metadata

Assignees

No one assigned

    Labels

    styleNitpicking and things related to purely visual aspect for formatting.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions