Skip to content

Grouping of function application #44

@HarrisonGrodin

Description

@HarrisonGrodin

Currently,

val _ = this is an extremely long function application which must be wrapped onto additional lines due to its length

formats to

val _ =
  this is an extremely long function application which must be wrapped onto
    additional
    lines
    due
    to
    its
    length

It feels odd that the grouping happens per application; I would expect

val _ =
  this
    is
    an
    extremely
    long
    function
    application
    which
    must
    be
    wrapped
    onto
    additional
    lines
    due
    to
    its
    length

since the entire nested function application can't be grouped together.

My immediate thought for a solution would be to write a simple auxiliary function which traverses the left spine of an App until it reaches a non-App, performing the group only at the top level. It would be nice if we could accomplish this without violating compositionality, though... (That said, given how common curried function application is, perhaps it wouldn't be the worst place to add a special case?)

Metadata

Metadata

Assignees

No one assigned

    Labels

    aestheticsImprovement to code formatter output

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions